Various cleanups in C++ files.

This is mostly removing some useless #include and fixing types. My editor automatically fixes trailing whitespaces. Let me know if that is a problem.