Restructuring to allow more functionality in templates

- if, while, for and foreach can be used in templates
- CONDITION and LOOP removed
- Pragmas replace SCENE and TEMPLATE commands, use #SCENE and #HTML_TEMPLATE instead. Run-time name resolving available for #HTML_TEMPLATE