When loading entries, redirection to the login page if the server responds with a 401 status is achieved with angularjs $http interceptors, instead of explicitly controlling this response in the error callback.

This will be extended to all $http calls in the angularjs application, reducing the amount of boilerplate code.
Redirecting the user to the login page if an AJAX request is responded with an HTTP 401 is done with a $http responseError interceptor in all cases, instead of explicitly controlling this case in every error callback.

This also removes the need to inject the $window service into many angularjs services.

Much DRYer now.