Cosine distance metric

Adds a Cosine distance metric to `metrics/pairwise` and KNN.