Updated the way events are triggered so that event implementations can take template parameters.