Style.
Make all for loop variables local.
Unset dir since local can only be used in functions.

* In 0.4.0 we should probably add a chruby_reload function.