Split scheduler.cpp into more files

Initial work to split scheduler.cpp into more files.