adds template parser, templates, fixes bug in model prototype