Move wait-for-events code out of watcher test
Simplify watcher interface; add unit tests; fix bugs uncovered by tests