Rename History class to NodeState.

The class is storing current state and statistics rather than full history and
it's node specific, so the new name seems more descriptive when I looked at the
code after a few months and tried to remember what it was doing.
Add history saving support to optimise runtime.

This avoids having to re-parse every single logfile every run.
Merge branch 'master' of github.com:mattbnz/smarthouse