Add unit tests and improve the webpage/script with the enhanced JSON data format