Moved some low-level lexing stuff to another module.