Re-worked the event system. Now with priorities!