Decode entities properly.

Devices are stored in a mix of edn and json atm, which is wrong and
should be fixed. We should create a one off job for this.