Save device version also.
Allow array element access.
Try to persist the userAgent string if possible.
Existence checking.
Update the entry if it exists, don't just ignore any changes.
Only remove the device entry when all user entries are gone if we didn't explicitly remove a single entry.