Add a test for labelfunc
Add repeat option to dotprint (True by default)

Previously, common subexpressions were printed the same way, so they would
result in the same nodes in the graph.  This would lead to things like x +
x**2 giving

      Add
      /\
     / Pow
     \ /\
      x  2

Now, it will give

     Add
     /\
    x Pow
      /\
     x  2

This problem would occur with any common subexpression.  The most common cases
were reused Symbols and reused numbers (especially -1, which occurs with any
subtraction or division).

Another consequence of the repeat=False behavior is that if a common
subexpression appears in two places in the args of a single object, only a
single edge is used.  Hence, with repeat=False, the number of edges coming out
of an object is not necessarily the same as the number of args that object
has.  For example

dotprint(x**x, repeat=False)

    Pow
     |
     x

dotprint(x**x, repeat=True)

     Pow
     /\
    x  x

I implemented this by appending a signature to each node name corresponding to
its position in the expression tree.  For example, for expr = Add(x, Pow(x,
2)), the signature of the second x is (1, 0), meaning that it is
expr.args[1].args[0].

I also removed the API to let functions define how to dot print themselves, as
it uses nonstandard naming, and will break if we add new features like this
one.

I fixed an instance where atom should have been used instead of defaulting to
not isinstance(expr, Basic).

(sorry, I didn't bother to split these last two things into separate commits)