Fixed issue #18
added function mkdir_ifneeded
Merge branch 'issue_18'
Merge for Issue #18