Fully implemented SampleReader and WavFileWrite. More minor bug fixes.