documentation, tests, fixes #101 and couchdb