Fix error printing when parsing and save the last error.
Errors would have a line number relative to the string of text being parsed,
but if this is in a larger file, then it's useless. So add a callback that
can modify the line number for parsing things nested in a larger document.
This gives proper errors for parsing actions in the xml config files.
Also, change how errors are given back when creating a new action. Instead of
printing it directly, return an error string so the parser can show what line
the invalid action was found on.