Move main() from training.c into main.c