JavaScript deep object cloning (with cyclic reference support)