assortment of cleanups and edge case resolutions
passes own doctest once again after cleanups and simplifications
cleanup after selftest
reformat to pep8
setup.py doc fixes
Merge branch '201401_rayg_tests' into develop