Support buffer objects

Signed-off-by: Paul Brook <paul@nowt.org>