Major cleanup.

Removed obsolete files. Added missing requires, etc.