Fix bugs in marshalling Rule Templates with package and import statements
Fix use of Imports on TemplateModel. Ensure Template editor refreshes if Imports change.