reduce complexity of format diff for large files
reduce complexity of format diff for large files

Before it used to always count each position linearly from the start of
the file, so diffs at the end of the file would take much longer to find
the positions of. The well working movePositionBytes function is used
to use previously counted positions as we only move linearly
forward, making the complexity at most O(n) while before it was
roughly worst case O(n*n) where n is document length.

Pure-D/serve-d