Refactored model classes (and changed other pieces correspondingly), adding skeleton for Unit tests