allow ipython console to handle text/plain display
test for text/plain display handling in console
refactor starting and stopping pexpect
removed unused imports
don't double display in the console

hand_rich_data was also used by pyout, refactored so we don't display it
twice.
Merge pull request #4678 from ivanov/console-display-text

allow ipython console to handle text/plain display