Fix OAuth2Session to work with Python3 and to function properly after a token refresh

There may be some other places which need changes to work properly with Python3, but so far these are the things I've run into.