Setting up test cases for URI parsing, and refactoring some URI parsing code.