More generic fixes to work with 3.1
Adding stronger validation to the models.
Adding more tests to ensure validation works.
Bug fix to ensure that the own class is tested with other subclasses.