More robust code to interact with CouchDB: Do not crash the program if CouchDB is not up and running, more logging.