Add TextBuffer and add Text methods.

This is based on changes in this patch:
https://bugzilla.gnome.org/show_bug.cgi?id=725125#c8