StatsCode

Most of the stats code is moved over to object attributes.  Its still
pretty clunky, but it does function and pass all the info to the DB and
the GUI.