scale back trimming of template whitespace, fixes #107
make sure widget names are unique