Loosely reproduce the functionality of .NET StringBuilder