Rob js refactor

Google OAuth and refactored JavaScript to specific namespaces.