Composite models changes (#1158)

Implemented composite models as a subclass of Model so that they can be nested.