Added permissions backend and refactored couchbase client code
Merge branch 'master' of https://github.com/OPENi-ict/type-api