Performed some major cleanup on the parser.