Set up rails and move existing code into libs

Also create a simple home controller to check things are working