clean up self references in ModuleTemplate and add :order to :save and :update