Normalise whitespace in template files

Fixes #103.
Merge pull request #117 from nickstenning/fix-newlines

Normalise whitespace in template files