make paths relative to full couchdb url

I have private npm registry behind a nginx which is doing encryption. Shortly speaking, nginx is proxying data from `https://my.example.com/couch/` to `http://my.example.com:12345/`.

This module fails to login there because it counts all urls (like '/\_session') as relative to domain root and requests `https://my.example.com/_session/` instead of `https://my.example.com/couch/_session/`.