Fix for multiple plots in the IPython notebook.

Comeback to curplot instead of curdoc in the IPython notebook environment.

This closes #1024