MAJOR: chunks: replace struct chunk with struct buffer

Now all the code used to manipulate chunks uses a struct buffer instead.
The functions are still called "chunk*", and some of them will progressively
move to the generic buffer handling code as they are cleaned up.
55 files changed