Lexer: add a rudimentary lexer and some tests.