Nicer syntax for adding hooks.

As described in README changes.