Break out some things from armoryengine.py.