Inject context into hooks

Fixes #60 via #102 and @dinopetrone