$.Deferred() is just what I needed