Refactored some code. Fixed another batch of small bugs. wav2flac and wav2mp3 are now working.