Support XDG base directory specification

Fixes issue #109.