Replaced ~str with StrBuf where necessary

Avoided changing API for now, so used .into_owned() to convert back to ~str for return.

"make check" fails (and was not run), but was failing before these changes.