c5fec90465
It turns out statefulness works quite well with this algorithm (The prototype was in Haskell, which created some artificial problems. I think it may have just been too high-level a language for this near-instruction-level algorithm).