(#1732) Batch replicate one generation docs

Update of @jo commit made couple months ago to work with master. During replication, batch query documents using _all_docs.  If the document has been deleted, has attachments or its revision is greater then one, fall back to single document query. It fixes #993