COW List and Map Property expansions

Previously Lists and Maps were being copied even if they didn't end up
expanded. Reduce this extra work to only happen when it is actually
needed. While this change doesn't currently seem to improve performance,
it's nice to have on the off chance that expansions become much more
used, and it actually simplifies the code a bit by reusing the
CopyOnWrite class.

* Non Walking *
Before this change: 1m17s 1m21s 1m8s 1m5s 1m5s
After this change:  2m17s  1m6s 1m1s 1m2s 1m16s

* Walking *
Before this change: 1m54s 1m52s 1m47s 2m1s  1m47s
After this change:  1m58s 1m52s 1m48s 1m57s 1m50s

Change-Id: I574fac786bf8637fd37d265396aa41dd0e968e58
1 file changed