Move login code to MainController and add MBProgressHUD