Build a reasonably efficient packet writer implementation.

Needs to be pretty fast and do way fewer allocations than this prototype.