Add support for OAuth2 refresh tokens

Replaces #189