Models and unittests for models

Models and unittests for models.