add pre and post hooks
add documentation for pre and post hooks
Merge branch 'feature/post-hook', closes #104

(see section Pre and Post Hooks in docs/hooks.rst)