Move the part processing cursor in main.cpp to an independent class.