fix bug in unifying cyclic types and add a type graph dump for graphviz visualisation.