Moved array variables for template and output into the first foreach loop for the files so that it creates an empty array for each output file and doesn't add previously compiled templates into later template files.  This fixes issue #22
Merge pull request #24 from seankeating/master

Bug fix for issue #22