Add beforeTick, afterTick, pause and resume events