Add unit tests to wav package and refactor

Moved constants out, some refactoring of sample extraction. Added unit tests for reading wavs.