initial support for using CouchDB as the backend store. refactor later.