More refactorings. Plus a couple of minor bug fixes (like multiple-definition of things in url_decode.hpp