Update code to run from command line.
Remove deprecated code.
Rename for clarity.