Boiler plate code to start reading the file.
Starting to build the xref object by indexing all titles.

Apparently I haven't fixed the problem with end events being emitted
more than once.