CosineSim test accomplished. Other minor refactorings
Cosine Sim Test, minor refactorings