Refactor generic oauth2 features back into pyoauth2 project.