Generally getAttachment can be implemented using only get in all adapters. As we do have such functionality it does not make sense not to use it. This is first try of this small redesing: * getAttachment is implemented entirely using api.get * _getAttachment is used as internal functions by our local adapters. Now it does not have to check whether it gets txn or not. It just must get txn. What's more, it does not must get attachment metadata and it's used only by api.get which gives those requirements to it correctly. This is implementation of these ideas in idb only.
In order auto_compaction to work I moved modification of the whole rev_tree into compactDocument in generic adapter. It then sends revisions which we want to delete and modified rev_tree to adapter specific method which does the compaction process.
parseDoc and merge have to support new availability option