Better handling of xbmc connection errors; ability to turn the display on and off depending on rules.

Should commit more often, allows for smaller commits...