Restructured couchlib to more closely reflect the native couchlib api