Flesh out the schema and add DeviceHistory and test (incomplete)