Starting support for OAuth2

This is the start of the implementation of the support for the OAuth protocol (related to issue #89). This isn't actually completed yet, I'll still work on it for the next days, but I thought it would be good to hear some suggestions and have others contributing while still in the beginning.

I just implemented the first transactions between the server to establish authorization of some application but it still needs some error handling. And, most important, there's need to include the support for the rest of the API operations, by sending the access token.

First, I started following the same implementation before (global variables) but then I thought to do it the best way.