Template is now cached after the first request.
Fixed problem where files were never closed after opening them.