Handle circular refrences

This seems to handle circular references of objects and arrays.
Keep track of references we're currently comparing.