Add lexer.
Refactor next-string.
Refactor elem.
Rename terminal? to terminal.