add stdin to the notebook

adds a simple stdin handler to the notebook, so things like raw_input and %debug work.

%debug in action:

![debug](https://f.cloud.github.com/assets/151929/306355/29a3cf00-967a-11e2-8b2e-6e1211c40565.jpg)

This PR depends on #3011 and #3088.  Incentive!