Cleanup DOM and JS

before working on #52 and #38