Refactors CouchIO classes to reduce duplication

Yay for less code!