Move reuseable code from switchAllMediaWikis to switchAllMediaWikis.php

Change-Id: Ief98747799eee5d1591276921c2e8b303434169a