Remove unused imports from IPython.core
Remove unused imports from IPython.config
Remove unused imports in IPython.lib
Remove unused imports in IPython.utils
Remove unused imports in IPython.extensions
Remove unused imports in IPython.html
Remove unused imports in IPython.kernel
Remove unused imports in IPython.qt
Remove unused imports in IPython.terminal
Remove unused imports in IPython.testing
Fix test import
Merge pull request #3518 from takluyver/unused-imports

Clear up unused imports

Static analysis revealed a load of things that are imported but not used. I've tried to leave things that look like part of the API, and clear up other things.

Noticed a few test functions which had been copy-pasted without changing the name, in which case only the later one will run. I gave them separate names.