Initial import, extracted from xbmc-callback-daemon