Add some notes in doc/
Generalize & clean up url parsing

Also submitted similar code to node core in
https://github.com/joyent/node/pull/7878