Moved config to CouchDB. Error handling & logging.