Add checks to avoid NPE if not configuration defined for a device.
Tidy code
Merge pull request #1543 from cdjackson/zwave-config_npe

Zwave config NPE checks