Sets up an event system.