fix routing of non-wikipedia on beta cluster

5f63c1f12 / https://gerrit.wikimedia.org/r/#/c/85165/ broke the $site
detection for the beta cluster. It removed the docroot based site
detection but forgot to update the beta part to capture the project from
the domain name. Thus $site was always a wikipedia.

The end result is that en.wikisource.beta.wmflabs.org would be mapped to
'enwiki' instead of 'enwikisource' (since wikipedia is the default
site).

Also fixed up database suffix when the project name is 'wikimedia'. Beta
use a 'wiki' suffix for them, not 'wikimedia' from the domain.

Added in some more test cases to cover the english wikis and some other
wikis present on beta cluster.

bug: 58271
Change-Id: Ia0d83ed7fede7a16c2c1cc16ee13fb7d06764bf3
Merge "fix routing of non-wikipedia on beta cluster"