Improved HTML generation

- Previously, it used a fixed filename(), i.e. HTMLPATH, for all graphs. This may cause problems when generating multiple graphs at the same time. Now it uses tempname() to generate a filename, which results in different file paths for different plots.

- Previously, it used JSON.json to generate the entire spec string, and then embed it into an HTML string, and write that string to a file. This ways incurs the generation of huge string, which is unnecessary. The modified version directly uses JSON.print to write stuff to a file, thus eliminating those temporary strings in memory.