Refactored file structure to allow app to be mounted into a Rails application