Implement while loop. Fixes #12