Refactor directory creation into its own function. Make sure dirs are always present
Merge pull request #8 from timlinux/master

Refactor directory creation into its own function.