Replace deprecated optimist library with yargs and update tabs to spaces

CLA is complete.