Refactor script into functionally separate scripts; add result_white_lower output as csv and rdata file.