create datastruct dir if it doesn't exists

this fixes a FileNotFoundException when running Relite
Merge branch 'develop' into develop-dmz
fixed flatMap codegen bug; added test case