Adds hooks to the xevent main loop, see issue #13.

Hooks allows handling of messages that don't conform to the package's
routing mechanics.

Hooks return true to allow the message to be processed as normal, false
to abort processing of the event, presumably to implement it all in the
hook's callback.
gofmt