Eliminated the use of Maps that were losing the ordering of elements in the template. The order of resources in the inlined template is now the same as the order of resources in the parent template, and inlined resources appear in the same order as in the inlined template.