don't use `get_ipython` from builtins in library code

mainly adds `IPython.get_ipython()` as a library-level handle that does the same thing.

We still use `get_ipython` from builtins in two ways:

- We use it *a lot* in tests and I haven't changed those, but I can if we want to.
  The same instance mechanism should still work there, it doesn't need to be a special case.
- Some code uses `get_ipython` from globals as a test for 'are we in IPython?`,
  which seems appropriate, though we can perhaps define a single,
  official test for that and make sure we use that everywhere.


This also fixes the issue discussed in #3285