Massive updates.

Lots of TODOs taken care of. Reorganizing, etc.