Cleaned up gemfile dependencies, fixed several minor bugs and started refactoring the rails configuration