XPath: Minor string operation refactoring

Extract end of string to rend and add comments to translate_table.
XPath: Refactor eval_once to use set type

This will allow us to implement nodeset_eval_last evaluation mode if necessary
without relying on a fragile boolean argument.
Minor refactoring of tree modification

Remove redundant this-> from type() call (argument used to be called type,
but it's now type_).
Use _root member directly when possible instead of calling internal_object.