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
import CouchBase docs

git clone git://github.com/janl/couchdb-docs.git
cd couchdb-docs

rm -rf DocKit Makefile Makefile.bootstrap README.md common couchdb-manual-1.1 couchdb-release-1.1 metadocs

git checkout 9fc95b422060d020ba25f559e893fc7fb98c9a15 -- 'couchdb-manual-1.1/*.xml' 'couchdb-release-1.1/*.xml' 'couchdb-manual-1.1/images/*.png' 'couchdb-release-1.1/images/*.png'

tar cvzf couchdb-docs.tar.gz couchdb-manual-1.1 couchdb-release-1.1
export DocBook XML to RST files

using pandoc 1.9.4.2:

pandoc --smart --preserve-tabs --normalize --reference-links --chapters --number-sections --standalone --from docbook --to rst --output rst/manual.rst couchdb-manual-1.1/*.xml
pandoc --smart --preserve-tabs --normalize --reference-links --chapters --number-sections --standalone --from docbook --to rst --output rst/release.rst couchdb-release-1.1/*.xml

remove XML
Move .rst files into Sphinx Layout

- Move rst files and copy images into a Sphinx project
- Split manual & release docs into smaller pieces
- Update version numbers
- Move API docs into separate directory
Clean up imported .rst

- Fix markup of errors section
- Fix caution blocks
- Add back JSON structure reference
- Clarify what kind of contents should go in views
- Add back configuration option reference
- Add TODO.txt for future reference
- Add tables to start of API reference sections (except for design docs)
- Fix indentation
- Add syntax highlighting
- Add to-do statements
- Fix weird `_` escaping
- Wrap statements
- Add method descriptions
- Clean up tables
- Add missed `PUT /db/_revs_limit` description
Align sphinx & autotools

- remove manual.rst & release.rst files, only used during migration
- prepare conf.py to be run from share/Makefile similar to:
  sphinx-build -a -E -W -n \
    -D version='$ver' \
    -D release='$ver-git-sha' \
    -D project='Apache CouchDB' \
    -D copyright='$year, Apache Software Foundation' \
    -c `pwd` \
    -d /tmp/ \
    rst/ \
    `pwd`/manual

- set sphinx config:
  - update copyright & project
  - set default syntax highlighting to JSON
  - output docs to share/docs/manual
- move into share/docs/rst
- move old 1.1 .rst updates into main area
- add release.rst for future release notes
- swap specific versions and releases for sphinx variables