add support for ends-with function

reimplements XPath 2.0 ends-with function using XPath 1.0 string, substring and string-length functions.

see http://www.w3.org/TR/xpath/#section-String-Functions