Easier function hooking

Much easier to set up various kinds of hooks into class and global
functions.

Also fixed the logging plugin logging a team change when it had been
denied.