common: fix containerof to be consistent with the rest
buffer: implement creation and destruction