Move the model creation to a class

This change moves the creation of the model to a class that can be reused in several scripts.
This merge replaces the one from runFBU_class-> master.