Added caching of device IDs
Added caching of device IDs
Added tests for device id saving