Add logic to only save tokens when the data changes.
Merge branch 'remove-global-context'