Experimenting with JS generators to create coroutine-style code... i think