Add directory creation, fix #44
Merge pull request #46 from srod/mkdir-file-out

Add directory creation, fix #44