Refactored, added Cluster class, changed to use both cossim and dist.