html-writer: Begin refactoring to generating json data

Use template HTML files and generate JSON data instead.