Add custom_hook support. Fixes #103