Initial partial implementation of stats.py.