General template cleanup

* Add more template tests
* Parameterize more attributes
* Use default values instead of blank values (blanks cause issues)
* Several template bugfixes ported from production usage

Change-Id: I7165ca3f2a4e3359b1e8a673c1f53e1938625cbf