Update discovery

This code is pretty ugly.  I think it's getting less ugly but it's still pretty incomprehensible.

It does works significantly better though...
Yeah, this is due to my low-tech testing with nosetests and raw `assert`.  There is a lot of this junk lying around.  It's how I mimic the higher-tech `self.assertEqual` style tests.  In most tools it doesn't seem to print stdout if a test passes so this has been harmless.  Should I switch out to a different testing style?