Refactored code into two separate classes: Beat and Treat.

Beat handles the audio. Treat handles the canvas drawing. The
window.onload now takes care of initializing a beat, loading it and
enabling buttons (or not if AudioContext not supported), initializing
the treat, and starting its animation.