Port functions request_uri() and request_path() from Drupal 8.x.
Rely on request_path() instead of _GET['q'].