MDL-33472 google plugins: move helper functions to upgradelib.php

upgrade.php is reserved for the upgrade steps only. See also
MDL-34103