Add preprocessor to execute notebooks

I basically copied all of this code from @damian_avila'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.