Cleaned up and added rails stuff
Merged and fixed conflicts