refactored the test loader to iterate once and be a bit more readable
Merge pull request #617 from crismali/refactor-test-loader

refactored the test loader to iterate once and be a bit more readable