Since the first key is used in every comparision, precompute its character position.
Need to review interactions with MergeMode.
The use of iter here is curious. In keycompare(), it's only used to select the precomputed key positions on the first iteration. At the very least, it is being incremented too often - it should only be changed in the else clause near line 1027. However, because of the way a->keybeg and b->keybeg are established in findlines(), it may be completely redundant.