Aaah squeaky clean.

Major code cleanup.