Hook support:  Proof-of-concept

Suggested patch on how to implement before/after hook support.

Conflicts:
	cmd.c
First try
Needs work; memory-leaks, function splitting, etc.
Rename hook_remove to hooks_remove.
Introduce cmd_list_new() to create a new *cmd_list

Useful where a cmd_list struct needs to be allocated -- such as when dealing
with hooks.
Insert hooks in to the cmdlist as appropriate

When a command list is being appended to, iterate over it to insert the
various hooks as required, both before and after the command.
Define cmd_context.
Make preparations for cmd->prepare()

Setting the context for hooks.
Call prepare() before finding hooks

When iterating over the cmdlist to ascertain if there's any hooks to run for
a guven command, call that command's prepare() function which indicates hook
support for that command exists.  It will set up the context for the command
which the hook commands can then also use.
Start defining prepare() for cmd-new-window.c
Start defining prepare() for cmd-run-shell.c
Make hooks work properly
Ammended new-window for prepare()
Flesh out more commands to use hooks.