Fixes an issue with high id being too high after recovery

due to giving the IdGenerator the wrong highId in its constructor. It used
to give it fileSize/recordSize, but now gives it the highest inUse record id.

Also deduplicated 3 versions of rebuildIdGenerator, 2 versions of
figureOutHighestIdInUse (which was badly named btw) and some other
deduplication.
Merge pull request #3095 from tinwelint/1.9-fix-too-high-id

[1.9] Fixes an issue with high id being too high after recovery
Fixes issue recognizing inUse of dynamic record

the check looked at the whole upper nibble of the inUse byte and expected
it to == 1, which means that it would not recognize it as inUse if any
other bit in that nibble was set.
Only reserve ids in reltype store, no other token store

since they just weren't built for it.
A tool for shuffling log entries