Return MetaData from Decode.

It's needed to understand the raw bytes that are output.
Also, cleaned up writeWAV.