Event system overhauled

Overhauled event system