Fix JSON syntax error in example
Attach hooks during initialisation too, fixes use in production mode

Fixes #5, #9 (I hope)