Sympy updates

The changes are orthogonal, so you may skip any that are disagreeable.
Everything seems to work as far as I can tell, having worked through most of the
sympy tutorial.