JavaScript serialization that preserves behavior and reference circularity.