Added simple event handling, including a default listener.