yanked out all the generic continuation opaque monad stuff and used a specialized state+kon one; worry about generalizing it later.  cps conversion is now correct in the way it handles state, and sufficiently compact.