B-0 refactored to work with any TStream rather than only with TMemoryStr...

...eam and also added const to certain places where passing strings as params to routines