Split defs and grain screen code to separate files.