Batch hooks

Fixes #2