Fix OS daemon log formatting
Refactor oauth source tree
Refactor couch source tree
Remove unnecessary includes and search paths
Squash into f40f349
Remove second fd from couch_db_updater

This reverts the change to use a second file descriptor for
couch_db_udpaters to split read and writes. This is ground work for the
next few patches that change how databases are managed.
Remove couch_ref_counter and use process monitors

This patch removes the ref counting code that used process links and a
gen_server to manage when databases are idle. This is important ground
work for the refactoring of couch_server which relies on having a sane
interface to managing database.

This code has two major parts. The first part removes the gen_server
from couch_db.erl and instead relies on checking who's monitoring the
database's couch_file gen_server. The database is idle when this list
only includes the updater and possibly the couch_stats_collector which
monitors open databases.

The second half is how couch_file's are managed by listening for who is
monitoring them. If they're monitored by only zero or one process then
they close themselves. This allows for the semantics of staying open
long enough to handle any current connections while being replaced with
a new couch_file (ie, due to compaction).
[squash] to couch_file ref counter refactor
Refactor couch_server for performance

This is a backport of a change in BigCouch that changes the behaviour of
couch_server to be more performant as well as be more robust under heavy
load.

There are two main parts to this change. First, it removes the need to
have synchronous message passing between the couch_server gen_server and
every process that wants to open a database that is already open. It
does this by using a protected ets table that is used to by pass having
to talk directly to couch_server.

The second major portion of this patch rewrites the LRU handling inside
couch_server so that it doesn't turn into an N^2 loop when the
max_dbs_limit is reached and all databases are in use.
Shorter internal btree names in records
Configurable btree chunk size
New fields for chttpd and friend
Store #full_doc_info{} records in the seq tree

This improves the performance of compaction and replication by not
requiring a btree lookup for every row in the by_seq tree at the cost of
storing extra bytes on disk.
Squash to #full_doc_info{} in by_seq tree
Use exported functions for code upgrades

We need to make sure we're not holding onto anonymous functions for
indefinite lengths of time. Due to erlang hot code upgrades processes
will die randomly after two upgrades when they're holding old code.
Load validation functions on first write

Clustered databases need to consult the cluster to grab their
validation functions. To avoid unnecessary loading as well as some race
conditions of the load we delay the load until the first attempt to
write to the database.
Disable conflict detection for _local docs

This can lead to breakage for internal cluster replication.
Enable clustered multipart-mime uploads

We have to insert a middleman process into the parsing so that each of
our copies can retrieve the data as its uploaded.
Remove use of init:restart/0

We've had issues with this so avoid it when we can.
remove some logging