Implemented a URI factory that doesn't suck.