Rework examples to run from both the command-line and the browser