Make hooks more like setting options.

Rather than copying the globally-defined hooks in to sessions which would
then make global hooks static, instead treat them the same as options, and
honour the global hooks across all sessions, and allow overriding them in
sessions.