Improve while-iteration
Add tests
Cleanup, improve monadic stack