Minor changes to support command-line mode.
Removed old code.