Refactor tokenizer to prepare for per-state loops
Don't re-dispatch on tokenizer state when it hasn't changed

Speeds up tokenization of webapps.html by 15%, and of plain text by 25%.