Added the loop tests to the test runner

Also:
- fixed a small bug in the tests
- added a test for using recur in the wrong place
- updated docs