WIP - Major refactoring of the ORM.