compute extract path basename based on tarball name

The top-level directory in a tarball is usually the same as the filename
minus extension. This can be easily computed if our source url ends in 
`.tar.gz` or `.tgz`. We can fall back to the resources name and version 
if the source url is wacky (aka a GitHub generated tarball url) and does 
not end in a file extension.

This change also allows `remote_install` resources to have unique name 
in the resource collection.