Part 1 of many. Remove some unused/pointless code, and made some code static.
mindtct is mostly as-is for now, with just a couple of bits ripped out.