[Reviewer: Matt][From: Alex] Refactor stats/stopwatch code to make it possible to integrate with homestead.