Re-route some of this code to tf2.inc's functions.  Also, more cleanup on other things.