Serialize circular javascript object graphs