Start to add support for defining entity types
More tweaks
Get entity level errors implemented
Fix some small bugs
Cleanup