Cleanup the previous PR
Use a hand-rolled url parser, re #152