Initialize DOM elements on first usage

Fixes #202. Also means the nasty document load stuff can be taken out.