Add serialization support for StrBuf

- implement Encodable and Decodable for StrBuf
- implement to_json for StrBuf