Cleaned up the command-line arguments handling.  Added support for flat-list parsing and formatting.