OAK-631: SegmentMK: Implement garbage collection

Add SegmentIdFactory.getReferencedSegmentIds() and some simple test cases.

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1559834 13f79535-47bb-0310-9956-ffa450edef68
OAK-631: SegmentMK: Implement garbage collection

Make it more obvious that the FileStore.writeSegment() operation is fully synchronized.

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