fix various and sundry breakages, move to rjson which is less insane