hook: simplify contexts

Rather than passing the context in with the callback,
we provide a way to set the context when the hook
executes.

This means that exactly the same set of objects can
be used at registration time as hook execution time.
Merge pull request #3 from rogpeppe/005-context-refactor

hook: simplify contexts