Strategies to prevent/identify memory leaks in HTML/JS