fix(compiler, view): centralize TemplateElement checks and fix inconsistencies

Fixes #189
Closes #194