Performance improvement in Stream handling

Store stream data into a list and only merge it into a string when requested. This removes the overhead of constantly building new strings.