URI prettyfication, take II

This started out as a simple rebase, to make your patch apply on top of my strictness work. While I was doing that, though, I finally figured out how to refactor this so it's clean and orthogonal. Hopefully you like this new version. I think it gets the best of both worlds, while cleaning up the parse/decode division as well.