Test with end line trigrams
Reorganize and minor cleanup

Move deprecated code to bottom.
Group like functions together with section header.