Merge pull request #16 from dimagi/cz

take another approach to cloudant 412s, doing a hacky exception loop
Merge pull request #17 from dimagi/cz

a fix that might actually work (and a test to prove it)
more generalized attempt to fix race conditions