Pre-cleanup: passes nosetest
Mostly cleaned up; more testing to to do