Changed ParseAndEmit to compare parse event sequences

Comparing the emitted text with the original fails due to differences in formatting details. This request instead parse both texts and compare those sequences.

It also make use of EventsHelper (formerly ParserTestHelper) to make the Emitter tests nicer.