#1599 Create functions that implements most of the content of more common mains
Sonarqube underlines rightfully there were duplicate in main files - and most of the content is mostly developer stuff that is of no value for a mathematician (mostly exception catching).
So a function has been made to reduce greatly the three most usual main in models (run the model, create Ensight output and update Lua file).