Adds functionality to generate ipython notebooks for the gallery examples

Any .ipynb file is in effect JSON. 
Also added sample ipynb file which is used as a reference to construct the ipython notebook for that particular example.