Refactored buffered API, together with doxygen documentation.