Ensure urljoin doesn't ignore base path

This fixes the 403 error when the repo baseurl is defined without a trailing slash.

e.g. When `baseurl=http://BUCKET.s3.amazonaws.com/repo` is accessed the metadata url is mistakenly mapped to `http://BUCKET.s3.amazonaws.com/repodata/repomd.xml` because `urljoin` drops the "repo" path suffix.  The resulting url doesn't exist and s3 response with a 403.

Also noticed that if using the `--enablerepo` command-line argument the repo isn't replaced by an `S3Repository`.  I changed to using the `postreposetup_hook` to fix this.

Lastly there is some general cleanup included.