[SPARK-2359][MLlib] Correlations

Implementation for Pearson and Spearman's correlation.
`sortByKey` is done through a range partitioner, which means records having the same key will be inside the same partition (please check the code and confirm). So `mapPartitions` should be sufficient to break ties.