Generator has sb and calc weight

Generator now has a stringbuilder instead of a list again and it also
counts the weight at the same time as generating the message.