Clone of Sebastian Pipping's uriparser with some bug fixes