Makes login more robust, adds function for autoretrying data tasks.