add `addHooks` method and support for global hooks; document