[1.9] 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.
It would be very helpful to have a comment about what reserved record is used for