free-semiring: implement printing and evalution

This implements printing to string as well as to dot format.  In
the latter case we get the DAG containing all the FreeSemiring
objects.  Moreover now we can also evaluate the FreeSemiring when
given a map from variables to values.