Refactored entity import in template editor. Fixed form-within-form issue.