Removes common code from the model mappings classes.
Fixes some unit tests.