(#3070, #3171) - Improve consistency of error handling

When handling errors the message should always be a string and match
the one defined in errors.js, and reason should be the reason
given by CouchDB. Errors from validate_doc_update (forbidden and unauthorized)
should match errors.FORBIDDEN and errors.UNAUTHORIZED and their
reason property should be the value thrown

Provides a single error handling mechanism for both browser and node and
single and bulk doc operations.
As a result:
- new errors are always created so that a newer errors do not override
 properties of previous errors (in bulk docs operations).
- errors contain information about which docs failed (their ID) and the reason
 of the failure. Particularly helpful in replication errors.
- error.message is the 'message' specified in errors.js and error.reason
 is the 'reason' given by the response.