login: moving a lot of the core oauth/gapi logic into login module