Use IO::Memory to build the raw data

This is much nicer than using Bytes and fixes always sending 512 bytes.