Refactored a lot of the audio code to maximize immutability and
cohesion.