Make foreach,repeat,while delayable

Use a callback engine to make it possible to add delays in
foreach/repeat/while commands.