Wrap all file accesses in a with statement to ensure they are closed properly
Merge pull request #16 from google/fix_file_closing

Wrap all file accesses in a with statement to ensure they are closed properly