Managed repository template path expansions

Refactors managed repository template path expansion to allow extra terms.