Major OAuth code refactoring

I de-duplicated a lot of code in the OAuth1 and OAuth2 classes, I moved some variables to instance properties to simplify the method signatures. The database loading of State and Provider is now executed outside the OAuth code, this will eventually allow to fully test the code with unit tests.
I tried to keep all the single commits very specific.