Easy way to gc the device collection.
Only save to backend if the data is dirty.
Need === here to avoid casting.
Disable state gc in the Mongo driver for now, something's broken.
Logging
Reduce this to one, maybe two, queries.