Add hooks section / use named hooks in examples. Fixes #1173