Actually, both of these methods (urlEncodeNonAscii and iriToUri) appear to be called in only one place. Maybe we should just inline them and make url_values a module level function?

Also, I thought that this part was going away in favor of the Document plugin.