Further work on parser

Fixes or improves the state of some of the open issues on the parser. Additional refactoring regarding lookahead