Refactor createlinks.sh

- updated to follow current styleguide
- create xdg basedir directories