Rearrange JS a bit and fix resizing bug

JS code for the waterfall was unnecessarily split between two locations,
so I moved the code for creating the canvas element into waterfall.js. I
also removed the hard-coding of the waterfall canvas element id in
waterfall.js. Finally, I added code to make sure that the waterfall is
resized when the window changes size.