Memory improvements to procs.py and other cleaning.