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
Configure 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.
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.