refactor avro3 io

this will make it easier to add buffer support and gzip support