Add tests for models and utilities

This adds test files using Specta for the model classes and the utilities
class. It also inclueds some fixes to the models since making the tests
revealed errors.