create_buffer_from_document: move from cainteoir.cpp to document.hpp