stats.py and test_stats.py now use new dm class.