Update working_script.R

Updated with all conditional loading of packages, writing figures to plots directory etc
Analysis should now run end to end.