Implemented the parser, with basic unit tests.
Also changed the lexer to return an input terminator token at the end.