Add StateChangeWatcher and start to use it.

It is used alongside the old code to check if it does the
same thing.
StateChangeWatcher is used fully in UnusedTokenHighlighter
Remove unused code
Change StateChangeWatcher to factory for consistency
Merge pull request #508 from latin-language-toolkit/state-change-watcher

State change watcher