Refactored $http and $sailSocket interceptors.