Honor "w" parameter for update handlers

BugzID: 17936
Fix cancel by replication_id

BugzID: 17969
Allow ?deleted=true on doc GET's
Use couch_httpd_db:parse_copy_destination_header

Remove parse_copy_destination_header and use the function defined
in couch_httpd_db instead.

Requires cloudant/dbcore@e9745834c164f6ef7f9e583bc4c36cdd83c415f4
so that parse_copy_destination_header is exported and has the
relevant backported code to throw an HTTP 400 if the COPY request
header does not have a Destination field.

BugzID: 18659
Remove trailing whitespace in chttpd_show
 Add X-Couch-Update-NewRev and X-Couch-Id to _update response

This is porting commits from CouchDB:

ef7ab7e4e414d53fe5c12993d29b193ed3cdfd42
 - allow client to get new _rev from _update via X-Couch-Update-NewRev
 - I left out porting the JS test
98515bf0b990ca096ec5a47b9cd048427a0ec66c
 - Return X-Couch-Id from show functions if doc is created
Allow write quorum control in POST body

BugzID: 18457
Give fabric a string, not a number
Add _shards db handler auth check
Reject large Range requests

Return a 200 response for any Range request that covers the entire entity
or that contains more than 10 byte ranges.

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1168196 13f79535-47bb-0310-9956-ffa450edef68
Throw 400 bad request not 500 for unrecognised _changes feed param
Throw HTTP 413 is max_document_size is exceeded

BugzID: 19888

This is a backport of
Apache/CouchDB@bf1eb135f2b46861474b9276dee02d8edb05fe3b
Add _reload_query_servers, report stale proc count

BugzID: 19529
Provide a dedicated NOLB mode

Setting [cloudant] maintenance_mode = nolb recovers the original
behavior of setting maintenance_mode to true; i.e., the node will not
participate in load balancing but is otherwise an active member of the
cluster.

BugzID: 18955
allow case-insensitive content-type from external, and other cleanup

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@823378 13f79535-47bb-0310-9956-ffa450edef68
Return stats for couch_file mailboxes in _system requests
Handle undefined result from process_info

BugzID: 21827
Remove unnecessary pattern match and associated extraneous _rev check

The pattern match breaks when users submit _bulk_docs requests of the
format:

    {"docs": [[{"_id": "foo"}]]}

couch_doc:from_json_obj/1 already performs the appropriate _rev logic,
so that check is unnecessary.

BugzID: 21746
Validate _bulk_docs POST bodies

This patch supplies some necessary input validation that
couch_doc:from_json_obj/1 can't provide. It eliminates spurious HTTP
500s and stacktraces from _bulk_docs POST bodies of the following
invalid formats:

    {"docs": {"_id": "foo"}}
    {"_id": "foo"}

BugzID: 21746
Add boilerplate for global_changes