Fixes #5719: Sets context from URL during system boot.

This also moves getUrlSegments to the request so we don't have to create another method in the router to set the context. If it would be more appropriate to put this logic in the router than in page_owner_boot, we can go that route instead.