Rewrite outputter to use an html template and javascript binding of the data
Generate JSON using to_json, not manually