Clean up parser a bit, fix test compilation errors
Tidy up the lexer a bit