Simplify url_basename

Use urlparse from the standard library.
Merge pull request #1997 from rg3/simplify-url_basename

Simplify url_basename