Changed main perameters and the system in which the information is logged.

The setup now instead of trying to keep track of the previous states within the main log, the system can look through the log files if it wishes to lookup data for the purposes of graphing.

Main elements such as temp, battery status and whether devices are on / off will be saved with the main device info.

I've added a couple of flags - not sure if I will need them but it seems like  a good way for external programmes to communicate that there were changes which require replicating / sending to the devices.