Move handle-event to its own function.
Start with a blank stack if none is given.