Cleaned up and fixed login code and added offline login for google