Refactor p1lapchart function into p1lapchart-html2json.js