Unit tests for core/model

It fixes and implements some unit test for the package model in the core module.