a round of CareLink fixes (suspend/resumes, basals, settings)

@kentquirk @jh-bate This is ready for review, including tests. I'm going to start commenting in line.
This was a fun bug!

If settings haven't changed recently, the device ID (remember, we're appending upload IDs to MedT device model names/numbers in order to keep track of potentially overlapping uploads) from the current settings object may be from a previous upload, so using that `deviceId` will yield data that appears to have crazy overlapping uploads.

Changed it to just use the last event the simulator processed instead.