Use new 4.1 wp_json_encode function instead. Include it (and helpers) for back-compat.