Add methods to get StreamContext from tag, and mark it as recognised
Separate methods are needed to be able to restart reading from a stream in the case of errors. Tag should be marked as recognised only after successfully reading the stream.
Closes #2225 (closed)