Make DFA algorithm more explicitly DFA-like.
Merge pull request #1 from daf-/scanner

Make DFA algorithm more explicitly DFA-like.