event based rewrite

small core with everything going through events
Continued from above, but i also don't think you should assign to "arguments" in javascript since it's a builtin.