Feature/couch

A bunch of changes to support plain couchdb with mirrors