rebalancePartitions now returns a PartitionMap
moved stateNodeCounts slightly lower