ZMQStream is the right object to use for event-driven handling of messages, but instead we chose to rewrite half of it in KernelManager.
This removes most of the duplicate code, in favor of using ZMQStream.
also use the pyzmq install() function for using pyzmq with tornado, instead of manually pasting its contents in notebook app.

I'd suggest not forcing unix users to update to > 2.1.4 if we don't really need it (in my case I can do it easily, but someone could be in a situation where they have for some reason a harder time), but emitting a warning if you have to use the fallback. That way we prod people to upgrade to avoid the warning. What do you think of that approach?

Since it's just this one function that we need, which is literally two lines of code, I'd leave out the warning. There are very few changes of any significance to people not using pyzmq directly, after 2.1.4. Most of the changes to pyzmq since then are user-level sugar, or related to libzmq-3.x compatibility.

ZMQStream is the right object to use for event-driven handling of messages, but instead we chose to rewrite half of it in KernelManager.
This removes most of the duplicate code, in favor of using ZMQStream.
also use the pyzmq install() function for using pyzmq with tornado, instead of manually pasting its contents in notebook app.