Change optimist to yargs in examples

This change updates the example files to use the yargs module instead of optimist.