Reset to default if max_dbs_open is deleted

max_dbs_opens is present in the stock default.ini so it appears we've
never deleted the value so far, just changed it up or down (mostly up
;))

When this property is deleted, reset to the default value.
Ignore all casts, not just foo
Add couch_event dependency
Send 400 bad request rather than 500 for invalid base64 in auth header

Along with a useful error message.
Export parse_copy_destination_header/1
Update all view/search index shards on ddoc update

This update is part of the fix to trigger view/search index updates for
all shards when a ddoc is updated. In the past, we only triggered
indexing jobs for shards which contained the ddoc. Other parts of the
fix are in ken and fabric. This particular commit contains the
following:

- A new couch_db_update event, which will be used in ken to spawn
  indexing jobs.

- A new function clause for the local _changes feed couch_db_update
  handler. This function clause will cause the _changes feed handler to
  ignore the aforementioned new couch_db_update event.

BugzID: 10979
Switch notifications to the new couch_event app
Update couch_auth_cache to use new couch_event app
Update couch_changes to use new couch_event app
Remove old couch_db_update_notifier code
Add uuid and epochs to couchdb database header

All .couch files now have a uuid value that is preserved during
compaction. This value can be used to distinguish one .couch file from
another. In addition, a list of {node(), non_neg_integer()} tuples is
recorded showing the highest update sequence used since the last time
that the value of node() changed. This allows us to know if the
database file has moved and received writes since the last time we saw it.

BugzID: 19133

Conflicts:
	include/couch_db.hrl
	src/couch_db.erl
	src/couch_db_updater.erl
Remove ets table scan on process exit

This commit adds a new ets table for doing O(1) pid-to-db-name lookup.
This is to remove the necessity for doing an ets table scan on the exit
of a monitored process.

BugzID: 19132
Add backwards compatible key_group_level option

This adds a new btree reduce fold option called `key_group_level` that
can have the value `exact`, `0`, or `N` where `N` is any positive
integer. The reason for adding this is so that calling code can pass a
group level option instead of a function for key grouping. The important
point is that the new option uses the btree's defined `less` operator to
test equality which means that ICU collation is used for key grouping on
most views.

BugzId: 19776
Add config for couch_server LRU updates on read

This commit adds the ability for couch_server to ignore update_lru
messages. This should reduce load on couch_server when few entries are
being expired.
Use a #proc_int record internally instead of #proc

This allows us to add more information to an OS process without
disturbing the proc manager API.

BugzID: 19529

Slightly modified to include #proc{} and #proc_int{} handling in return_proc.
Allow graceful reloading of OS processes

This patch adds a reload/0 command to couch_proc_manager that will cause
all OS processes to be reclaimed at the next earliest convenience (i.e.,
when the current client is done with the process).  It also adds a
get_stale_proc_count/0 function to report the number of processes that
have yet to be reclaimied.

BugzID: 19529
Fix typo in pattern match
Allow operator to forcibly terminate stale procs

This patch adds a new terminate_stale_procs/0 command which kills off
any OS processes with spawn times older than the current threshold time,
regardless of whether the process has a client.  It also refactors the
internals to use the same logic to terminate a process in every case.

BugzID: 19529
Improve code_change and #proc{} imports

Going forward we should define default values for all fields of a
proc_int that are not shared by a proc.  This allows us to implement the
general import_proc/1 function that I've added (and used in code_change)
here.

BugzID: 19529
Fix use of lists:sublist/2

The lists module has pretty terrible consistency on which argument is
the list. This one happens to take the list first.