Fix JS errors for 2.x

As mentioned in https://github.com/ipython-contrib/IPython-notebook-extensions/issues/150