Use DOM ready to initialize stuff.

Initialize sooner in the pipeline, gotta go fast. :stuck_out_tongue: 

Also fixes issue in Chrome where the anchor (e.g. `index.html#bbf`) wouldn't work, presumably because the `bbf` element is not yet in the DOM when the anchor scrolling is done.