fixes fb 40731 and corrects some CouchDBisms
Merge branch 'master' of github.com:cloudant-labs/slate