allow dir to be optional param for generator

[Fixes #131]