Add fallback support for AngularJS $q if jQuery is undefined