Added event hooks

Still nothing actually tested yet, but it compiles.