Some refactoring to address an issue with the order libraries are loaded.

Removed some unnecessary gems from the Gemfile.