use json-stringify-safe in render.js to not throw on circular structures