(#3084) - API-level debug mode

Holy wow, this is one of the most exciting things we've added recently. Good find @daleharvey.

Check out this beautiful log output. I'm actually going to start using this when I work with PouchDB myself! It's actually great for revealing performance bottlenecks; e.g. you can see how many times it calls `compactDocument` when auto-compaction is turned on.

![][https://raw.githubusercontent.com/pouchdb/pouchdb/4740ae7c343b004dc0f85201e09748c34abc4f4f/docs/static/img/debug_mode.png]