Converted events.tin to hooks.tt, added oneshot and debug code to the hooks.