Add purging of client result cache to parallel.Client

The new methods clear the cached values and free some memory.

The whole thing is split into different methods to both clear the
client and the hub side.

Additionally fix some bugs in other parts of the code.
Add Testcases for new purging methods in parallel.Client

Signed-off-by: Jan Schulz <jasc@gmx.net>
Optimise a check for empty jobs/target lists

If the inputs are empty, no msg_ids should be returned. So change the
test to not only check for None but also for empty lists.

Signed-off-by: Jan Schulz <jasc@gmx.net>
Remove outdated code from extensions.autoreload.

imp.getsuffixes() raises a DeprecationWarning under Python 3.3;
in order to fix this I just removed _get_compiled_ext and
PY_COMPILED_EXT because they are no longer used
(see 8a8884b399cf3f5b761313bf0d446ba204f2c810
and 2911f3ed7db45ec2571772a9e25513559d480179).
P3K: fix cookie parsing under Python 3.x (+ duplicate import is removed)
Allow caller of MultiKernelManager.start_kernel to pass kernel_id.
General cleanup of kernelmanger.MultiKernelManager.
Removing return value of restart_kernel.

The kernel_id is *always* the same under a restart and there
is no need to return it. The restart handler does pass
the original kernel_id back to the browser as it currently uses it.
Creating application.config attribute.

This creates less coupling between the handlers and the outer
IPython application.
Refactoring kernel_died method to make subclass friendly.
Adding tested ipc support to MultiKernelManager.
Fixing bug in connection file cleanup.

ipc files were not always being removed.
Adding calls to shell_channel.stop() to shutdown.

But this hangs the test suite for IPython.frontend.html.notebook.
Fixing bug in cleanup of ipc files and adding new to shutdown.

* ipc files were not being cleanup on a restart.
* shutdown has a now argument that will call kill directly.
Cleanup naming and organization of channels.

* Change remaining use of "sub" to "iopub".
* Use consistent naming of channel classes across zmq, inprocess
  and qt.
* Move BlockingChannelMixin to zmq.blockingkernelmanager.
Creating an ABC for kernel managers and channels.
Make InProcessKernelManager a Configurable.
Fixing missing metaclass in KernelManagerABC.
Cleaning up MultiKernelManager test and adding linger=0 to shell.

We are finding that the tests for MultiKernelManager hang because
linger default to oo in the shell channel. By setting it to 0,
the tests pass fine. Last night, we thought it was particular to
the ipc transport, but now the hang occurs for any transport.
Renaming test_kernelsession to test_kernelmanager.