Updated render function so if this.context is defined that is passed to the template instead of the model