Unit tests working
Fixes to SparseVector along with unit tests
Fixed one database query in getdistribution