Fixes for docs (use textContent instead of deprecated innerText, define drawCharts earlier, and add Array.from polyfill to Safari)