1) Added speed test for the sparse cosine distance.
2) Fixed a bug in tests.