Further refactoring of HocrTransform2.