Improve lexer and add more tests