Add unit tests for stats package