Ex-Sun editor to take up UK government communications role