Big cleanups and code reduction.
37 files changed