Replaced the old task event hooks test suite.

The new version tests every event hook, and checks the arguments passed
to event handlers.