DR-117 Optimize XUri parser

Ticket: https://youtrack.mindtouch.us/issue/DR-117
Reviewed by ArneC