implemented CRUD for design documents
implemented CRUD for design documents

Inside CAPI frontend we now support 'logical' databases aka buckets and
physical couchdb databases.

Because all frontend operations go through do_db_req we detect
logical/physical db difference and for logical DBs we pass 'empty'

logical vs. physical operation based on that.

Design docs CRUD itself is implemented by redirecting all design doc
operations to 'master' physical database. Which is source of truth for
design documents.

Normal docs CRUD is still stubbed out. As well as a bunch of misc
operations.

Change-Id: Iefdcd611fa1e9875148d73dfcde7a8289aa8a7ce
Reviewed-on: http://review.couchbase.org/7854
Tested-by: Aliaksey Kandratsenka <340b8e09ca65cd3fc686427fcfed17e87eaf61e2@gmail.com>
Tested-by: Dale Harvey <491ccac09a36ad1e38b698f273b84fd8efc31071@arandomurl.com>
Reviewed-by: Dale Harvey <491ccac09a36ad1e38b698f273b84fd8efc31071@arandomurl.com>

ceejatec/ns_server,pavel-blagodov/ns_server,ceejatec/ns_server,ceejatec/ns_server,pavel-blagodov/ns_server,ceejatec/ns_server,membase/ns_server,nimishzynga/ns_server,t3rm1n4l/ns_server,t3rm1n4l/ns_server,mschoch/ns_server,nimishzynga/ns_server,mschoch/ns_server,mschoch/ns_server,vzasade/ns_server,ceejatec/ns_server,vzasade/ns_server,t3rm1n4l/ns_server,mschoch/ns_server,ceejatec/ns_server,nimishzynga/ns_server,membase/ns_server,daverigby/ns_server,nimishzynga/ns_server,mschoch/ns_server,pavel-blagodov/ns_server,nimishzynga/ns_server,daverigby/ns_server,membase/ns_server,membase/ns_server,vzasade/ns_server,daverigby/ns_server,t3rm1n4l/ns_server,nimishzynga/ns_server,pavel-blagodov/ns_server,daverigby/ns_server,vzasade/ns_server,daverigby/ns_server,membase/ns_server,t3rm1n4l/ns_server,mschoch/ns_server,membase/ns_server