Add basic protocol versioning

This needs to be fleshed out, but for now it's good enough.
Add more thorough buffer API

We need received buffers to be malloc'd too.  This makes a buffer object
that gets a ref count and can be used to tell n3 what to send, and to
receive data as well.  This'll be needed when packet reordering comes
into effect, where the immediately received data might not be the data
returned to the client.

This also makes use of the new API.  I made a couple other tweaks in the
message protocol to make things easy, so I bumped the version number.