Adds use of several now standardized functions from kspmc.py, and removes
superfluous local definitions.