Nicer handling for GitHub URL common cases

Special cases for commonly encountered GitHub URL forms.  Includes a fix for #3160.

@njx, want to review this one too?  If you want & it looks close enough, we could just merge it and I'll bundle the code review cleanups into the same pull request as the #3158 cleanups.