Refactoring AbstractTemplatePackagingContext as well. refs #459