Rework config and data directories lookup

Adhere to XDG Base Directory specification on Linux, use `%APPDATA%` on
Windows and `~/Library/Application Support` on OS X as base relative
directories for data and config files.