Authentication fixes: grant_type and json response handling
Authentication fixes: grant_type and json response handling

* sends `grant_type` parameter for code exchange
* accepts both form-encoded and json responses from token endpoint

cweiske/shpub