Refactoring

The DeviceEntity should have the ScheduleEntity since each Device can
contain its own Schedule.