TeX parser: rewrote without parsec's token parser.

This way it's simpler to see what is happening.