Change preview to use BytesIO instead of StringIO

This fixes it to work in Python 3. Since BytesIO is available in Python 2.6,
the use of StringIO has been deprecated. See
https://code.google.com/p/sympy/issues/detail?id=3984.

This fixes, in particular, init_printing(use_latex='png') in Python 3.
Merge branch 'master' into preview_bytesio

Conflicts:
	sympy/interactive/printing.py
Make degree(0) == -oo in the polys

Previously, degree(0) was -1. This makes sense for the dense representation,
because then one can use degree in place of len(f) - 1, but outside of that,
it makes little sense. In particular, the very important formula regarding
degree, deg(f*g) == deg(f) + deg(g), does not hold unless deg(0) == -oo.
Therefore, any code that does arithmetic on a degree and then makes a
comparison against it (like "if degree(f) - 1 > 0"), such as some code in the
Risch algorithm) was previously for 0 but generally correct now.

Fixing this just means being more careful about when you mean degree(f) and
when you mean len(f) - 1 in the dense representation algorithms.  Another
argument for this is that the change in the sparse code required no additional
changes anywhere; apparently the degree does not correspond to any natural
quantity in the sparse representation.
Fix typo
Fix some additional issues caused by degree(0) == -oo
Wester test cases N12-O3 added
Corrected enf of file character
Wester test cases 04-P8 implemented
Wester N12-P8 test cases added
Issue 694: Add tests from "Review of CAS mathematical capabilities", by Michael Wester

Added test cases from N12 to P8.
Added Wester test cases P10,P11,P12
Corrected test cases N12-N16 after Randy's review.
Added missing test case P9.
Added P13-P19 test cases
Corrections after feedback from Aaron for P3, P9 and P12
P3 added. P9 was wronlgy named P3. __remove_whitespaces() removed. P12 corrected.
removed __remove_whitespaces()
Added caching to delta in concrete, for speed.

Otherwise, testing it takes a long, long time.
Split the tests for deltaproduct and deltasummation.
Fix the no_piecewise logic for recursive deltaproduct calls.

Fixes the first two tests reported in issue 3987, where a Piecewise
was missing to really make the result valid for all input.

Note that this does not address the Karr convention; limits have been
assumed and are still assumed to be in increasing order.

c.f. issue 3987: wrong tests in test_deltaproduct
http://code.google.com/p/sympy/issues/detail?id=3987
Corrected P19, added P20
Added Wester test cases P26-P41