First part of T2360 and not really interesting to review.
The diff simply moves existing code to a new module swh.web.browse.snapshot_context.
Some import reorganization and URL regexps polishing in swh.web.browse.views.origin have also been performed.