Authenticated parser.

Note, this contains a horrible hack.
Refactoring of parser.
Parsers are event-driven.