Implement more parser APIs

Notably the exceptions that parsers can raise. The two tests for the parser now should be correct.