Move the test code to rails structure for easier testing.