OAK-1804: TarMK compaction

Move the compaction map logic to a separate class for better encapsulation.
Use the fact that typically more than one record is compacted from each
source segment to optimize the memory use of the mapping. With the new
data structure (see javadocs), the amortized memory overhead of each mapping
entry is just 20/n + 8 bytes, where n is the average number of compacted
records per segment. That's significantly better than the previous 40 bytes
even in the worst case scenario of n = 1.

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1601757 13f79535-47bb-0310-9956-ffa450edef68