Some extra scripts for CouchDB