Split the big core.cpp file into separate files.