Added first pass at command-line flag parsing.
Added file handling and error checking.