Add preprocessor to execute notebooks

This adds a preprocessor to execute all the code cells in a notebook.

I basically copied all of this code from @damianavila's gist here: https://gist.github.com/damianavila/5208296.

I don't totally understand all of the error handling. This probably wants more robust unit tests, but I'm not sure exactly what I should be testing.