Refactor ObjectTypes.py to use faster string building code.