Moved router to JS file from CoffeeScript