Make doctest unit tests optional

Necessary because of the readline bug found on hgwdev.

cactus_progressive didn't have any unittests so the call to testmod
was just removed.
Misc. bugfixes

* cactus_workflow was using a python3 compatible method of reflection
  that failed on python2. class.__name__ works on both

* cactus_caf had asserts that fail to compile without NDEBUG defined