Extend utils/couch.py functionality and small codestyle fixes