* Move file utilities and add tests
Separates common file operations into their own component with
appropriate unit tests.
* Remove use of unittest.mock.mock_open
Its behavior is slightly different across Python 3.5, 3.6, and 3.7
making it difficult to test across Python versions.