(#3070, #3171) - make sure errors are helpful and contain correct info.

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.