CLI: Refactored to use stats/totals.js module