Add a new string buffer interface and use it for "templates".
Change error handling of strb to be simpler.
Revise the overflow check to work correctly.