Add templated function total_size_plus_one
Make BufferManager align buffer allocations according to content type