Added foreach to template and initial parse method to Compiler