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 liefinalintegration

Conflicts:
	sympy/solvers/tests/test_ode.py
Merge pull request #2375 from flacjacket/iteritems_fix

Fix print_cache
Merge pull request #2359 from Manoj-Kumar-S/liefinalintegration

Integration of the Lie Group Solving method
Changed sym matrix doctest from is to ==
Merge branch 'master' into seriessolve

Conflicts:
	sympy/solvers/deutils.py
	sympy/solvers/ode.py
	sympy/solvers/tests/test_ode.py
MatrixElement._diff_wrt = True
Remove the verbose parameter.
Merge pull request #2370 from moorepants/theano-travis

First shot at Theano on Travis.
Merge pull request #2402 from mrocklin/matrix-symbol-diff

MatrixElement._diff_wrt = True
Move matrix_inverse_mod to Matrix.inv_mod.
return 1 for z=0 early in _hyperexpand()
Implement series expansion for elliptic_e(z) and elliptic_k(z)
Fixed apparent bug at hyperexpand_special
elliptic_integrals.py: More short doctests for series + regular tests for series
Remove some heuristics in the e.is_Mul branch of limit()
Remove limit() heuristics for tan/cot
Cleanup e.is_Order branch in limit()
Remove e.is_Rational branch in limit()
Cleanup of e.is_Mul branch in limit()