Add support for substring function

See http://www.w3.org/TR/xpath/#function-substring