Fix normalize_dbname to work with slashes
Fix normalize_dbname to work with slashes

We shouldn't rely on dbname being the last part of path. Since database
name could include slashes.
normalize_dbname as the name suggests should accept either binary or
list and return only binary.

fkaempfer/couchdb,apache/couchdb-couch,apache/couchdb-couch,cloudant/couchdb-couch,fkaempfer/couchdb,cloudant/couchdb-couch,fkaempfer/couchdb,fkaempfer/couchdb,cloudant/couchdb-couch,apache/couchdb-couch,fkaempfer/couchdb,fkaempfer/couchdb