Tests added and bug fixed

Now the project support all grant types described in the RFC6749.