port interwikiFormat test and categoryFormat tests from compat

Change-Id: I63836e908e0b2bc6f0d7478a756cf6e9744a70a4
Merge "port interwikiFormat test and categoryFormat tests from compat"