Partial new TfwStr implementation.

A temporary commit. The work is still in progress. To be finished and
combined with other commits.