Rewrite states in Tokenizer

Signed-off-by: Oleg Bulatov <oleg@bulatov.me>