add refs to builtin loops #17
minor refactoring in for loop implementation