Fix tests, mock xhr, cleanup urls.js and implement new json format