A more flexible jQuery.when command for working with jQuery Deferred objects