With this commit we fix a few occurrences of loop variables being accessed in closures. While we touch the code, we also migrate it to using the require library.
t.Cleanup