Make ipythonnb.py work with new Pelican API

I'm using the latest developer version of the Pelican API, and there are some breakages due to refactoring in Pelican. This PR fixes the plugin with the latest version of the Pelican API, but someone needs to test it with the current version.