Restructured scripts so controls are done separately from main data analysis. This improves modularity.