WebAgg: Fix IPython detection.  Fix encoding error on Python 3

This is an alternative to #2832.

This fixes an error on Python 3 where byte strings can not be serialized to JSON.

This also removes `show()` as a way to display all figures inline in the IPython notebook.  This causes problems because:

1) In a regular IPython console, you want to start the plotting server blocking

2) In an IPython notebook, you don't

There is no way to detect which frontend you have for IPython -- in some cases, you may actually be using both.

So the solution here is to make `show()` always start a blocking server (and thus, it's only useful outside of the IPython notebook), and use the `Figure` repr to display an inline figure.