Added EventDispatcher class as base class for event handling.