Added core data versioning. Fixed issue with tests.