whitespace fixes
Url-encode document-ids properly

 - modify the helper to also urlencode on `%`

Closes COUCHDB-2342