Implement 'defer' function for very simple

deferred evaluation, and a switch handler in the main loop.