cleanup IPython handler settings

move any settings / shared objects to the tornado settings dict, rather than a mixture of tornado settings and application references, and application.ipython_app references.

Removes any reference to application / ipython_app attributes in the handlers, in favor of the tornado settings dict. These were a massive pain for anyone who might want to re-use our handlers.

This depends on PR #3011, it is actually just one commit (at this point).