add handles for buffers and use them for buffer IO

and add a way of testing buffers along with everything else