Refactored parser to work with new lexer module.