refactored Javascript namespacing in application.js