no longer output to file when navigates away/close window, this is done by calling the JS API, also added document.visualizerOutputToString to facilitate extension API.