created an InputReader to read all inputs together

InputReader handles opening and closing files by use of __enter__() and
__exit__() methods within the InputReader object. The object stores open
files in a dictionary.