Added shebang and __name__==__main__ part so now the script can be run from
the command line. Tested some, but not very rigorously. Works okay as long as
the format of the input file is correct (InputFileClass doesn't really do
input format checking). Added a try statement when looping over all files in
a directory so that an error in a single file will not cause the whole program
to quit.