Import new applications
Be more specific on the merge result

We have three results that can happen when merging a path into a
revision tree:

 * We can extend a branch which replaces a leaf
 * We can create a new branch which results in a new leaf
 * We can land on an existing internal node

The first result (new_leaf) means that there is no conflict in the
update operation. The second (new_branch) means we branched a revision
path which means the operation introduces a conflict. The third
(internal_node) means that the merge was the result of an edit that
has already been applied to this document.

For the third case we have a subtle special case in that if we have
deleted the document and want to recreate it into the same initial
state we need to give the new state a different revision. The current
code follows the edit path and extends the first deleted leaf it
finds.

BugzID: 25150

Conflicts:
	apps/couch/src/couch_key_tree.erl
Move attachment code into couch_att

This is moves a majority of the attachment representation
into the couch_att module. This serves to isolate the
current record to allow easier in-place upgrades as well as
a place to start collecting common attachment related
functionality.

The upgrades are handled lazily to allow rollbacks to older
code if the new attachment format has not yet been required
via storage of any of the new extended attributes supported
by the fetch/store APIs. There are some caveats to this in
that the extended attributes are not enforced by couch_att
at this time so it'd be quite easy to store garbage. As the
extent of attachment concerns becomes more stable, a set of
more permanent fetch_[field]/store_[field] functions may be
added to help enforce both field types as well as common
field names and defaults (all fields will default to
undefined except for those defaults present in the orignal
record definition, which carry over automatically).

Finally, while this patch does move a lot of code to
couch_att, it hasn't refined the interfaces much. These
changes will follow in later patches to improve and
simplify the organization of attachment code. This
includes the addition of more unit tests which currently
only cover some portions of the attachment functionality
related to upgrades and field fetching & storage.
Test all windsor-merge branches
Make clean recursive
Reformat rebar.config.script
Remove couch_replicator_manager as its in the OTP hierarchy now.
Have lager log to the console only by default

This is a short term fix to get lager to send its output to
stdout/stderr so that it is directed into the appropriate logs for
dev/run.
Include the node in log messages
Disabling this assertion until we figure out lager

The change to lager changed how w configure logging in CouchDB. We'll
need to figure out if we want to update things so that we can configure
lager from the INI files at which point we can either reenable this test
or remove it.
Fix replication.js test

Tweak hard coded assumptions about update_seq ordering for documents
posted to _bulk_updates. See the comment in replication.js for more
information.
Include new replicator_db support script
Allow tests runs to start at a given file

If you're running this using ./dev/run you need to use the -- to stop
option processing by ./dev/run like so:

    ./dev/run -- test/javascript/run --start path/to/file/start.js
Fix race condition in a replicator db test

There was a race condition where we could end up grabbing repDoc1 before
the replicator manager got around to updating it. Local timespans had
this in the 19ms range. Rather than slap a timeout on it I've added a
call to a longpoll on the changes feed to wait for the update.
Don't sleep mindlessly for 3s at a time

Attempting to compare the source and target update_seq values isn't
valid as any document modification on the source will permanently alter
the comparison. This changes things to just wait for the task's status
to update and reflect the source database's update sequence.

Locally this shortens the replication.js test by about 45s.
Use waitForSeq and task statuses instead of sleeps

Further speedups to replication.js. Now runs in 32s on my machine vs.
the 1m45s it started at.
Use the correct sequence for replication status

The value of source_seq is just what's been seen, not what's actually
been stored on the target. We expose through_seq now to show the actual
progress.
Include global changes in the release
make CI build faster
add devclean target that cleans out the dev cluster state