Remove sensors for non existent devices and delete unused sensors_to_state_indexes, state_indexes, and state_translations
Change sensors.device_id to unsigned to match devices.device_id
Add foreign keys to sensors and sensors_to_state_indexes for cascading deletes