Modified version of the stathat js api

I just modify the JS API since I needed to embed the graph in another node of the DOM not in the script tag itself.