Useful data persistence code, largely Core Data, written in Swift