Rework command line interface to support reading from single files and STDIN