Some sound improvements

I'm working on a project where I needed to make some additions to sound playback. I added basic wav support (8-bit and 16-bit PCM only) and fixed what looked like a few memory leaks. Figured other loom users might find this useful.