WIP - stage 1. Rename 'MapWithRunLengths' to 'MapWithSharing' and introduce 'SetWithRunLengths'. Currently, the former's implementation is not yet cutover to using the latter - they exist in parallel.
Trivial reformatting!
WIP - stage 2. Have completed an initial cutover of 'MapWithSharing', which now references 'SetWithRunLengths' in its implementation. However the latter is not yet used in practice - this will be introduced in the next commit.
WIP - stage 3. Now using 'SetWithRunLengths' at run time.
Amendment to previous commit - this file change should also have been included.
Excised some commented-out code introduced on this branch while I was prevaricating.
Removed another piece of commented-out code. Hmm.
WIP - stage 4. Realised that a) the calls 'MapWithSharing.Add' made by some of the unit tests were clobbering performance (C5 doesn't support functional operations efficiently with its collections) and that b) the client code used in the overall test case generation doesn't need to call it anyway. So the offending unit tests have been cutover to using a plain old 'Map' instead, doing last-minute conversions to and from 'MapWithSharing'. I'll sort this rather inelegany hackery out in the next commit, if possible, but for now this restores performance.
WIP - stage 5. Removed nasty interconversions between 'Map' and 'MapWithSharing' introduced in the previous commit - although there is one low-frequency code path that has introduced a conversion from 'MapWithSharing' to 'Map', which I'm happy to live with for now.
WIP - stage 6. Now using 'IDictionary' instead of 'Map' as the outbound partial test vector type when merging them. This has made the unit tests rather messy, but I think it makes the rest of the client code nicer (and avoids having to create new maps for bounced full test vectors.
Cutover node tests to using 'IDictionary', plus a minor change to the implementation of filling out a partial test vector.
Merge in the MapWithSharing work to see what its performance impact is.