simplified RankedRDD by implementing assignUniqueIds separately
moved couting iterator size to Utils
do not count items in the last partition and skip counting if there is only one partition