Add a test for issue 1054

Conflicts:

	sympy/integrals/tests/test_integrals.py
Reformat the Basic.rewrite docstring

Better indentation and additional explanatory doctests.
[solvers] implement minsolve_linear_system.
[simplify] Improvements to ratsimpmodprime.

Namely:

- fix a bug where denominators would be dropped
- add a parameter quick, and use solve(.., minimal=True, quick=True)
- if quick is not True, collect all solutions of the minimal total degree (but
  differing individual degrees) and use minsolve_linear(quick=False) to find
  the best
- make staircase() much more efficient
[functions/elementary] Implement cosh(x+y) sinh(x+y) expansion.
[polys] Fix eject().

Note that the changes in densebasic are most easily tested through the
polytools wrapper classes.
[simplify] Start trigsimp_groebner.

This is a function which simplifies trigonometric and hyperbolic fraction using
the groebner basis based algorithm ratsimpmodprime.
[simplify/trigsimp_groebner] Implement polynomial simplification.

This is a faster, but less good version. Also speed up some tests.
Better integration of trigsimp_groebner with rest of trigsimp.
[simplify] Implement "deep" for trigsimp with groebner.
Merge branch 'master' into integration3

This doesn't fix any of the errors that come up as a result of the merge,
except those that were specifically related to the merge, and those that
prevented sympy from importing.  Fixes will come in upcoming commits.

Conflicts:
	bin/coverage_doctest.py
	sympy/core/tests/test_expr.py
	sympy/core/tests/test_subs.py
	sympy/functions/elementary/exponential.py
	sympy/integrals/__init__.py
	sympy/integrals/integrals.py
	sympy/integrals/risch.py
	sympy/integrals/tests/test_integrals.py
	sympy/integrals/tests/test_rationaltools.py
	sympy/integrals/tests/test_risch.py
	sympy/matrices/matrices.py
	sympy/polys/domains/expressiondomain.py
	sympy/polys/domains/realdomain.py
	sympy/polys/euclidtools.py
	sympy/polys/polyclasses.py
	sympy/polys/polyfuncs.py
	sympy/polys/polytools.py
	sympy/polys/tests/test_densetools.py
Fix Sphinx docs to build without errors
Add __getattr__ to DifferentialExtension
Update DifferentialExtension code to use xreplace

This also handles the fact that sqrt(exp(x)) != exp(x/2).  We now just
automatically denest rational powers of powers in the preparsing stage.  The
backsubs dict is used, so something like risch_integrate(sqrt(exp(x)), x) will
come back in terms of sqrt(exp(x)) rather than exp(x/2).
Remove deprecated behavior from Risch algorithm
Fix test failures in Risch code in Python 3

zip(...)[1] does not work in Python 3.  The easy fix would be to wrap it in
list(), but I've taken the opportunity to rewrite things like

[... for i in zip(*G)[1]]

as

Ga, Gd = zip(*G)
[... for i in Gd]

(G is a list of fraction tuples)
Remove the poly_heurisch.py file

This was just a test by me to convert heurisch to use Poly instead of Expr.
The goal was to make it faster, but this didn't work, because the dense
data type that Poly uses makes it painfully slow with the highly multivariate
polynomials that heurisch uses.  If and when Poly becomes faster, we can dig
this up from the git history and try it again, but until then, this is just
cluttering up the filesystem.
Comment out warnings in Risch algorithm

They warn against possible non-termination in the algorithm.  This is useful
for debugging, but do not really belong in user code.  And as the comments
note, the code will not truly run forever, terminating at least with a
recursion error under the current implementation.
Rewrite some while loops as for loops
Remove unnecessary + from string concatenation