Support for sending clientId and clientSecret as basic auth header

I needed support for sending client id and secret as a basic auth header instead of the post body. This is part of the oauth2 spec and is described here: http://tools.ietf.org/html/rfc6749#section-2.3.1
The API I'm using doesn't allow to send the secret in the post body.

I have added a couple of new functions for the case when you want to use basic auth so this shouldn't break any existing code that depends on hoauth2.

I have checked that the examples compiles and that the Facebook example works (except for this bug https://developers.facebook.com/bugs/162050973983689/). I have not included a new example for the API I'm using (https://www.digipost.no/plattform/privat/autentisering) since you have to be a norwegian citizen to use it :)