Refactor to allow for Rails and Grape modules/functionality.