Implementing core data
Miscellaneous fixes