Complete the Model Management

Beyond a lot of fixes and a better model validation, this pull requests brings a lot of unit tests for the core.