listener for 401s application-wide

Added a listener on the $rootScope for the devise:unautorized event,
all it does is redirect to '/'. Might be too abrupt but works for
the time being. I also decided to fix some convention naming for
js/ruby.