Adding new buffer class.
Minor improvements to buffer.h