Internal event system overhauled

Overhauled the internal event system