Refactor template code to be more flexible

Major refactoring to use the new template code,
Updated credits file to reflect Glenn's work,
Clean up some file headers
Merge pull request #4 from stephenjust/master

Refactor template code to be more flexible