Added some unittests and cleanup (in statistics and linalg)
Added some methods in the testing area