Spring Cleaning

Removed many globals; translated some to static variables. Improved decoupling in the general architecture. A few other odds and ends.