add createSubFolders option

And added unit tests for the functionality
Merge pull request #157 from isochronous/master

add createSubFolders option