Rewrote some of the latex reader to use generics and properly match misbalanced fences
Operators now have correct position.

The position is now correctly calculated from the position in the row.

I'm not sure introducing a state object was the best way - it could have
been potentially easier in retrospect to modify the "form" attribute and
use existing machinery to pass that along. I'm not sure if this makes it
much cleaner but would be easy to change.
Improved diacritical mapping