Implementation of generic abortable hooks

BasicEmitter::emit now allows an additional, optional argument "$abortable"
to be specified. This defaults to false, in order to preserve the original
behaviour.
If $abortable is true, the return value of each function invoked by emit
is checked for a return value of false. As soon as one function returns
false, running the hook handlers is stopped and false is returned by
BasicEmitter::emit.

Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com>