Major parser refactor.