Move graphics mode and settings code to platform directory.