Output directory yet again

Didn't look for an existing pull request, and now I see there already is one for this very issue.  Oh well, here is my implementation.

Adds mkdirp to create the output dir if it doesn't exist already, FWIW.