Fix integration tests to pass on Windows.
Close reader after instantiating template from file.

The `processTemplates()` method now closes its source files before writing out
the processed versions, which is necessary on Windows. Otherwise it runs into
problems with file locks.