event based rewrite

small core with everything going through events
This will actually enumerate the arguments array keys (0, 1, 2) and not the keys inside the payload object which looks like what you intended.