core: refactor lexer to use Data.Text