usernames and passwords now URL encoded in `hostport`

urlencoding for usernames and passwords - rebased

(I didn't mean to delete the old pull-request, I was hoping that if I delete the old branch from github and pushed it again github would pick it up, but alas no)