Reduce required memory

Adjust the location of the sort and what gets sorted in order to minimize the required memory footprint.
Parse out changes to basal schedule
Parse out the current basal schedules
Parse out the current active basal schedule

Fix a rename gone wrong as well
Parse out current settings

Includes a restructuring of code to allow for reusing code.