Replaced sub_package_name with package.
Fixed all template calls to package_declaration.
Now the package is provided by the template context, not guessed in the template itself.
refs #379