Updates narrow_state.stream_id to have a boolean parameter, that
defaults to false. When true, the function will return an ID or
undefined based on the stream data that we have. When false, the
function will return the operand of the channel narrow term when
it's a valid number or undefined if it's not.
Replaces all uses of narrow_state.stream_sub()?.stream_id to
instead use the updated stream_id function with only_valid_id set
to true.
When the channel operand would return NaN for the ID value, we now
return undefined, so that there is only one invalid value being
returned by narrow_state.stream_id.
Renames is_for_stream_id to narrowed_to_stream_id, and updates it
to use narrow_state.stream_id for the comparison check instead of
getting the full StreamSubscription object.
This helper function is only ever used to describe the current view,
so it might as well be in the module for such views.
Also added the test coverage for "is_search_view".