Redesign the lexer, and add the tests for it