Circular data & cross references #110

Catch circular and cross references.
The object is first scanned to get these references before starting the writing algorithm. Aliases are then added during it.