[SPARK-2359][MLlib] Correlations

Implementation for Pearson and Spearman's correlation.
Using `case ((v, id), rank) =>` here can improve the readability of the code block.