oauth2 is now also a function constructor
Split OAuth2 methods into prototypes