json for node and the browser without mutating any globals