(#2008) - use es3ify
(#1931) - Reduce storage request in order to pass tests
(#1954) - WIP change batching for replication
Return results on change event
Return error XOR results to opts.complete
Fix error to bulkDocs write errors (still ugly but better)
Generate error and complete events
Call opts.complete on error and complete event.
Simplify changes mock in sync test
Simplify changes mock in test issue1175
Create listeners conditionally

Only create listeners to call opts.onChange and opts.complete if they
are functions.
leveldb workaround

leveldb changes ignores options.limit and doesn't stop when the changes
promise is cancelled. This makes it a bit hard to deal with in a way that
limits maximum memory consumption.

This workaround works, but performance is terrible when replicating a large
number of changes because onChange is called so many times.
Handle old and new API in mock
Workaround to leveldb/changes limitations
Disable fetchGenerationOneRevs

With fetchGenerationOneRevs enabled, replication of 500,000 documents
from leveldb to http takes several hours. With it disabled, it takes
under 5 minutes.
Make fetchGenerationOneRevs optional
Begin refactoring to use promises
Reimplement handling of revision 1 documents
Change fetchCheckpoint to getCheckpoint
Change catch( to then(null,
Unwrap db.get
Change getCheckpoint per suggestions from @nolanlawson
more idiomatic promise usage