rasham: implement simple streambuf wrapper for rope and fix some rope bugs

Signed-off-by: Alex Dubov <oakad@yahoo.com>