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.