Groom repo. Fix testing script.

Yesterday's cleanup + some better testing.