Core data classes and infrastructure (work in progress)