Added JQuery deferred objects support. 

The tiny changes to return promises