XDG directory spec

Fix for #109

This is a full implementation that uses $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS.
The rationale is that since CONFIG_HOME corresponds to /etc and DATA_HOME corresponds to /usr/share, everything should go in CONFIG_HOME.

This currently breaks support on Windows and Mac, so I'd like some pointers on what the config directories on those platforms are.
always declare the loop index variable within the for(). Though, I think in this case I'd prefer using an integer, like: ``for (int n = 0; ret[n]; n++)``, because that gets rid of the pointer fiddling and is IMHO more readable.