OAK-1866: SegmentMK: Inefficient flat node comparisons

Optimize the handling of diff map records as either before or after states instead of just after.
Avoid loading the entire list of entries to memory in MapRecord.getEntries() of a large map.

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1598797 13f79535-47bb-0310-9956-ffa450edef68
OAK-1804: TarMK compaction

Check first for externality of a blob to avoid the need to access the external binary in length()

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1598798 13f79535-47bb-0310-9956-ffa450edef68
OAK-1867: Optimize SegmentWriter.prepare()

Only compute the exact refcount value if a rough first estimate isn't good enough

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