Some fixes and additions. Dispatcher and handler now work.
some leak fixes ... but now I have a strange segfault in during cleanup, but only if the caller of eventHandlerClassCleanup is build with optimizations.