Hook up events to components.

Triggers are represented in an event's state as an index into the triggering component's triggers array.