Implement new database creation logic
Implement new database creation logic

The new logic decouples the creation of the shard files on disk from
the creation of the mapping document in the shard database.  Most
errors encountered during the creation of files on disk are ignored,
though we do bubble up 'file_exists' errors to the client.  Conflicts
encountered in the shard mapping database result in an immediate
failure.  A matching mem3 topic branch reports those conflicts when the
body of the revision on disk is different than the one we're trying to
save.  We report an 'ok' when every node reports that the desired
document body is saved to disk, an 'accepted' when a majority do so, and
an {'error', 'internal_server_error'} otherwise.  If any file already
exists on disk we'll send {'error', 'file_exists'} instead of 'ok' or
'accepted'.

This patch also incorporates the use of rexi_monitor to prevent database
creations from hanging when a node is down.

Thanks Bob Dionne for help with the implementation, testing, and review.

fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb