Cleanup: fixes nima/bashophilia#1

Cleaned up the preexec code along the way: there is no need to
manually register hooks, since we know what function names to look for
in advance and do not allow arbitrary registration of commands.

Code is now simpler and cleaner.