Add zsh's missing hooks, and support for user-defined hooks