Externalizing cmd.run arguments processsing
Adding mocha tests (first pass)