(#1732) Use allDocs to batch generation 1 docs in replication

This is a tweak of the original fix for #933 by @jo.  I updated it to pouchdb master and fix few things related to open_revs call.

All tests passes.  


It speed up the replicate a lot when most docs are one revision "old".