Consume all ibrowse messages before stream_next

The flow control in ibrowse's async response streams is tricky.  We call
stream_next to pull more data off the socket, but it seems that ibrowse
will sometimes split that data into multiple messages.  If we call
stream_next for each message we process we end up with an overflowing
mailbox.

This patch changes the consumer so that it clears out the mailbox before
calling stream_next.
Merged pull request #7 from @mikeymckay, with thanks
Document Id and Rev in response headers
Only return X-Couch-Id (rev is available in ETag)
Test the X-Couch-Id header
Allow any 2xx code to indicate success
Restore 400 error for empty PUT
Log problems opening database at ERROR level except for auto-created system dbs
Work around race conditions in tests on faster hardware.

THIS NEEDS A PROPER FIX.
Add rapid db recreation test case
Module Level Logging

With this patch, you can set log levels per CouchDB module that
overrides the default set in `[log] level = `.

For example:

    [log]
    level = info

    [log_level_by_module]
    couch_httpd = debug

This will have all modules log at level 'info' and `couch_httpd` log
at level 'debug'.

See src/*/*.erl for the various CouchDB modules.

Based on work started by Robert Newson.
update NEWS & CHANGES
COUCHDB-1424 Fix etap to not consume any message

Turns out that etap consumes any message in the mailbox in
some cases. This can make some tests that use message passing
hang, as etap itself consumes the messages.
Stabilize replication id

This patch introduces a stable server-wide UUID which is used in place
of the local hostname and port number in new replication ids. This
allows CouchDB to find a valid checkpoint even if the coordinating
node's port has changed (it might be using a dynamic port, for example).

COUCHDB-1259
Add couch_httpd_misc_handlers:handle_file_req

This can be used to serve up files like /crossdomain.xml from a
CouchDB instance. For example, you could add:

    [httpd_global_handlers]
    crossdomain.xml = {couch_httpd_misc_handlers, handle_file_req, "/usr/share/couchdb/www/crossdomain.xml" }

To your local.ini to serve up crossdomain.xml.

Closes #4
Support auth cookies with : characters

The parts of a couchdb authentication cookie are separated by
colons. One of these parts can contain colons and, more rarely, runs
of colons. The string:tokens function silently drops any empty token,
thus giving a spurious failure for valid input. The fix changes this
mechanism to one that losslessly decodes this part.

COUCHDB-1607
Make cardinality of result explicit, remove join hacks
Allow a final config override to be specified via environment.

This lets the OS X startup define this user's config which will be
used for editing and what-not.

Forward port from 1.2.0

Change-Id: I03ebce57030457e25c9c8cb60a679547a0cd84bf
Reviewed-on: http://review.membase.org/6380
Tested-by: Dustin Sallings <dustin@spy.net>
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Revert "Document Id and Rev in response headers" patch

This patch breaks some update handlers and also assumes that any JSON
response body with a property called 'id' is the actual id of a
created or updated document.

This reverts;
0a64f310b43b90176bb59040e7e866978c429c88
4edbb93d2271ac1eb82f4d2bb072b8bdf6829f85
b9af7ea506ac95034a91951f29e1f4249ef4317c
test for 1608