Template Logic

Let's introduce some template logic with basic statements usages, such as foreach, if then else and macros