moved all buffer implementations to buffers.js