Merge pull request #3 from amwilson/master

Extracted path creation to prevent command duplication when creating directory trees