SHAMap performance (RIPD-434)

Commit from previous pull request with updates thanks to suggestions given in that pull requests. Updates and bugfixes to address the missing node bugs:

More separation between snapshot unsharing logic and modified node flushing logic.

Simplify descend* functions so that they no longer modify SHAMapNodeIDs. (They were too tricky to use because it wasn't clear which functions modified SHAMapNodeIDs and whether you were supposed to pass the parent or child ID.0


It's built into so many places where it can't be used as a named constant that I'm not sure what the benefit would be. It's built into the serialization formats, the bit representation of mIsBranch, the algorithm used by getChildNodeID, and so on. Every place it's used it's obvious why it's used, and a named constant would be more verbose. So I don't see any real benefit.