Wrap file reading in a context to fix the issue that the handles weren't...

... being closed