cached Category::toTree() function
minor style fix at stats() function