Factor out iobuf into it's own module and increase test coverage