Adds use of several now standardized functions from kspmc.py and removes
the old local definitions of the same.