ERT390 + ERT388 Multi-phase simulations and model refactoring

Implemented support for multi-phase simulations and performed some refactoring of the related models.