Make sure output directory exists before writing output
Merge pull request #6 from gaborcsardi/fix-outdirexists

Make sure output directory exists before writing output