optimize how expandInstanceForEnv() merges datastructures
Merge pull request #1120 from drewfish/perf3

optimize how expandInstanceForEnv() merges datastructures