Move main.c stuff out of def.h