Generate js and html files automatically

1. Generate js and html files in each data file flush
2. Add an utility to generate js and html files manually