Remove sed call from update_language_packs

Solves #1267. Remove the sed call and change the header-removing logic into pure python.