Xdg Basedir for configuration file

Some improvements related to #112.
I'd like to make this an optional dependency (i.e. similar to keyring support).