Allow extension to work recursively over models

Currently, when a model extends another one, a shallow union is performed. The problem is that nested elements inside the parent model (like its `properties`) are not merged into the current one. Is this what you intended? If not, does this PR look alright?