Creating a class for carrying out rails commands.

This class encapsulates a lot of logic that wasn't very object oriented. The file for defining rails commands had quite a bit of logic inside of it which could be refactored. I've created a new class which handles the delegation of the commands.

Helper methods have been created to try to make things more logical and easy to read.