Implemented rev-tree pruning.

During database compaction, excessively-deep revision trees will have their oldest revisions removed
entirely. The depth limit can be configured as CBLDatabase.maxRevTreeDepth.
Fixes #118.