utils: Add mocks for read/write_file and tests for those