Major cleanup of commented-out code from mainDialog.