upgrade to solve

addresses issues https://code.google.com/p/sympy/issues/detail?id=3720, https://code.google.com/p/sympy/issues/detail?id=3721 and https://code.google.com/p/sympy/issues/detail?id=3722

**only the last commit needs review; the others are part of #1929**