fix(compiler, view): centralize TemplateElement checks and fix inconsist...

...encies

Fixes #189