Add an events framework which calls out to scripts.