extract AuthTokenFile domain object

This refactor centralizes the logic around reading/writing the authentication token file.

It is primarily intended to clean up the code in preparation for XDG standard directory support
Reverted to 1.8-style IO API b435ae37b2eb5e156f6975bd13da4cb280c6d259