Moved test-dependent code into tests tree

Previously the entire Rails environment would be changed. I prefer test-only code to be loaded by the tests only, and leave the Rails environment alone.