for (var i = 0 ; i < templateContents.length ; i++) {
if (templateContents[i].trim().match(/^\$\w+\s*=/) != null) {
// Grab variables to be used for later substitution in text
parts = templateContents[i].split('=');
varname = parts[0].trim();
values = parts[1].split(',').map(function(s) { return s.trim() });