Added toBuffer function on stringbuffer.
Added default size to stringbuffer.
Added a buffer to sessions so that we can handle patial data sends.