Improved JSON handling in XBMC plugin