TitleFormatter: Implement
fbc144965315 and unify prefix logic
fbc144965315 (Make Titles with an unknown namespace ID refer to
Special:Badtitle.) was never implemented in TitleFormatter, so let's do
that.
While we're at it, formatTitle() is now structured in the same format as
Title::prefix(), to make it easier to compare code between the two
implementations. The existing tests verify that this is a no-op. There's
a little extra indirection in getPrefixedDBkey(), which now goes through
dbkeyform -> textform -> dbkeyform, but reduces duplication of code,
which I think is worth it.
Bug: T165149
Change-Id: I4e43487a52663d2a647f9e71d487f58e25474f7a