[SPARK-2359][MLlib] Correlations

Implementation for Pearson and Spearman's correlation.
The `RangePartitioner` guarantees  same keys appear in the same partition. Then inside each partition, you go through an iterator of (value: Double, rank: Long). Do not output a value and its rank directly. Count records with the same value until a different value comes up, then flush out the value and the average rank.