Cleaned up code for distribution with Google OAuth2 Integration.