Beginning major cleanup for python library