History: first there was 79564b0ac7d03327cc351bbd6df544ab1f776380.
This preserved the order of copied pipeline templates, but that's in
part because it stopped recursing through those templates. 1b8caff3ad598744e4a0379b01fc95ca4838caa0 fixed the recursion, but then
started losing the order again. This retains the order by ensuring we
copy OrderedDicts as OrderedDicts.