Added SharedPtr to library for use with MemoryStream
Updated MemoryStream to use SharedPtr