Fix #2765 - Strip hash and query for matching.

This allows navigating to routes with a hash or query while only matching the path.  Note that it changes behavior *slightly* because fragments cannot include `?` or `#`.  However, I don't think they ever should anyway.

/ping @tgriesser