Lots more clean up, and beginning debug instrumentation