Improve lexer, add look ahead buffer