Added Onload, OnAway, OnIdle, OnExit hooks.