Stats and stat handling procedures implemented...

Implements stats and procedures for handling them, as well as comments. Still needs to have other areas of the code updated to use this system, though, since it was added in early, not too many.