Cosine and Mahalanobis distance

This PR implements Cosine and Mahalanobis distances.
I agree that such a function in floats would be useful as well.
But, if there is a separate package for distance computations, do you think the Cosine distance would fit there? I guess people would look for related functionalities in the same package.