pouchdb/pouchdb — pull request #2563 by nolanlawson (2014-08-03 22:05:01+00:00)
Title: (#2555) - fix 'change' event for db.sync()

This ought to fix it. I also added some tests to ensure we're not leaking any listeners. Apparently calling `removeAllListeners` in `cleanup` is unnecessary, because that gets taken care of in `completeReplication` anyway.