Refresh token support

Cleanup and adding support for refresh tokens