Support XDG_CONFIG_HOME and fallback to dotfile

Also using node's path API for more reliable path joining