Define hooks infrasructure

This adds an implementation hooks using a RB tree to store the name of the
hook and the command-list it uses.  These will be accessed via commands to
add/remove hooks.
Convert commands to use prepare()

Hooks need to know the running context of commands so that those hooks run
within the intended client/session/window/pane of the command they're being
run for.
Add man page entry for hooks

This defines a generic HOOKS section, describing a little bit about hooks as
well as the two hooks-specific commands to manipulate/show them.