MDL-46210 tool_langimport: Rearrange code

Factoring code into a controller class so that the update
can be put into a scheduled task (and be a bit tider).
MDL-46210 add scheduled task for updating langpacks