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.
Merge pull request #148 from Loamhoof/master

Circular data & cross references #110