Statistics for Combinatorics and the KP Hierarchy