Updates to the stats system

We have made some updates to the stats code to make it faster and more useful.  The recent changes speed web page creation in general and also cache team pages such that they can be read during stats updates.  This is the first stage of further improvements of the stats to come in 2009.