Added support for events (on, off, once, trigger)