Refactoring cosimilarity matrix implementation
Finished refactor for local sr matrix