Lexer refactor, using TextStream