Define a few hooks

[closes #39]
Merge pull request #45 from ForbesLindesay/hooks

Define a few hooks