Move stat helpers into utils.py

This makes census.py specific to an installation.