Undoing inversion of control with delimited continuations