implement controller template variables #31
remove duplicate controller template code
migrate template variables types to sets. phpelements are not suitable for eg foreach and caching