Fix source of nondeterminism in (fragment merging) CodeSplitter.

When doing code splitting if two fragments has the same estimated
size, their order would be determined by the iteration orders on
some HashMaps (which did not provide consistent iteration order).

Drive by changes:
  - a rename.
  - a fix in test code that would give the wrong error message.

Change-Id: I6369367c9e04382f93984d67f61a59bf84abaa20