CouchDB friendly JSON, thanks to @vals