Cosine and Mahalanobis distance

This PR implements Cosine and Mahalanobis distances.
To make my point somewhat more clear:
The Mahalanobis distance ... is a multi-dimensional generalization of the idea of measuring how many standard deviations away P is from the mean of D. 

In short, this computes the number of standard deviations given an assumption of a gaussian covariance matrix. Thus, it seems like it should be a method of the multivariate gaussian, where the meaning of such a covariance matrix is more clear.