Use precmd and preexec for prompt and command detection

Final Term now makes use of Glyph Lefkowitz's script from
http://glyf.livejournal.com/63106.html to emulate zsh's
"precmd" and "preexec" functions, directly extracting the
executed command from bash's history.

This fixes a number of bugs in command detection and enables
things that would have been near impossible using the previous
approach, such as correctly detecting multi-line commands.

Also, since zsh already supports precmd and preexec natively,
this suggests a natural route towards zsh support for Final Term.