Major refactoring, pushed OAuthCode to the library