Added support for jQuery Deferred (promise).