utils refactor
cs_cfg changed to class
minor io refactor
part refactor of io and state
refactored some more, mostly io
corrected usage of python reserved terms, import warnings, more io refactoring