Accept optional command line arg to replace `npm test`

Also adds `minimist` to help parse command line arguments.
because we have `dir` here, can we require `npm` from here instead?