Implement lookupModel to determine Model class at runtime

This enables a full Single Table Inheritance setup.