Pretty printing of Integral(x, x)**2.

Wrap an Integral with brackets when raised to a power. Do the same
for most objects, excepts if it is an atom (doesn't need brackets)
or a function (which handle printing powers differently already).

Fixes issue 3260.
Remove a couple TODOs.
use subprocess module in preview.py instead of os.system
make preview function threadsafe again
added support for a few new kwargs to the preview function + cleanup
use more kwargs for SymPyDeprecationWarning
updated docstring
reworded docstring
fix test failures
removed call to sleep()
fix doctest error

Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
preview: cleanup
unskip strinio doctest
preview: fix unable to open file problem
fix different dvi filename problem (cat template.tex | latex)

see PR1779 for a description of the problem
minor cleanup
fixed wrong import of StringIO function
moved find_executable from galgebra/latex_ex.py to utilities/misc.py
update docstring + remove 'import pexpect'
preview: replace "formatstr" kwarg by "preamble"