Revert "Work-around \middle."

This reverts commit 366e4a79b4ef73e7b991bb4e8546f3695764f044.

MathJax now supports \middle, so this workaround is no longer necessary.
Faster power of a matrix

A multiplication is saved computing `M**n`, which becomes typically
roughly `(1 + 1/log2(n))` faster for matrices of `order >= 10`;
for smaller orders there is still a speedup, but smaller.
3271: allow numbers from exponents to combine in simplify

Although factor_terms is used to change things like 2**(2+x) into
4*2**x, expand(power_exp=True) could be used, too. An added benefit
of using factor_terms is that a light factoring is obtained which leads
(IMHO) to aesthetically simpler expressions.
Merge pull request #1282 from asmeurer/middle

Revert "Work-around \middle."
Merge pull request #1288 from pernici/mat

Faster power of a matrix
Remove a test that tests the output of a specific random seed

This test fails in Python 3 due to a modification in the random number
algorithm, and this is not the correct way to test random functions anyway.
Merge pull request #1308 from asmeurer/rand_test

Remove a test that tests the output of a specific random seed
[polys] Fix a bug in sdm_groebner.

Specifically, the implementation of the chain criterion was faulty.
[polys] Implement build_order helper function.
[polys] Implement is_global attribute for monomial orders.
[polys] "beef up" DMP and DMF.

Specifically, make both of these classes optionally carry references to their
containing ring. Use this for pretty printing, and for unification.
Also add implicit conversion in __add__ etc methods, to allow short-hand
expressions like QQ[x].convert(x) + y.

Also fix PolynomialRing and
FrationcField comparison methods, and make sure they create DMP/DMF instances
with a containing ring reference.

Note that functionality tests are added in the (later) commit which implements
generalized polynomial rings.
[polys] Order structural equivalence.

That is, implement __eq__ and __ne__ methods for monomial orders so that
e.g. LexOrder() == LexOrder().
[polys] Implement generalized polynomial rings.

Generalized polynomial rings are polynomial rings localized with respect to
certain multiplicative subsets determined by monomial orders. They are
important since groebner basis computations work for such rings.

In order to implement this, rename PolynomialRing into a storage-agnostic
base class PolynomialRingBase. Create new subclasses GlobalPolynomialRing
and GeneralizedPolynomialRing to implement storage via DMP and DMF.
Create a helper function PolynomialRing to automatically instantiate
the correct subclass.

Extend domain class to allow passing optional arguments (specfically, orders)
to poly_ring.

Extend pretty printing to make this visible.
[polys] Fix doctests for new printing.
[polys] implement __div__ for DMP.
[polys] Implement additional conversion code.
Merge pull request #1199 from ness01/agca2b

Generalized polynomial rings
bin/use2to3 now makes converted files end in exactly one newline

The code quality tester checks for this, and sometimes 2to3 adds extra
newlines, so this keeps the tests passing in Python 3.
fix eof newlines with regex; only write if mods were made
In polyclasses.py, don't use `except as`.

`as` is not yet a keyword in Python 2.5.