Simple helper for handling promises in jQuery