Extracted metronome stuff into its own class.