Avoided using classtype/giveClassID in many places.
Removed really old commented code (which won't even work anymore), removed a few unnecessary calls to classtype.