Changes to decoder API.

File read/write API functions are now required to be able to only read
parts of a file (with specified offset and length), write to an offset,
and be able to offer a  binary mode read/write.