fixed exit of XBMC

Exit of XBMC, plus making it standalone that one can run outside the
xbmc