Task 54279: Backport contacts new-style tests

Checked out tests/ at 6ca92dd (end of initial fixes for ported tests) and
backported to 3.6.1