MIN Better repr() function
RFCT Use hooks mechanism for stats

This instead of using local functions