Read stdin or file.

With no args, read stdin. Otherwise use arg as input file name.  Move
file handling into main() so Timeline only has to handle a stream
either way.  Check for file I/O errors and print errors accordingly,
on stderr.