Bug fixes and adding missing support for certain operations

Hi, we started using encrypted-core-data for a project a few days ago and there quite a few cases of things that didn't work well with our existing code base. These were either bugs or missing support for certain things.

I've fixed those as best I can, I've also tried to keep the commits as small as possible, doing only one thing per commit so that they can be more easily reviewed.

Also, I noticed that you'd already considered using unique column names for object ids at some point but scrapped it which was unfortunate because we had quite a few models that had columns named "id". Any reason why you scrapped that change?(Because I had to re-add it albeit slightly differently because I hadn't noticed it was in the history at the time).

Let me know what you think of these changes, I'm willing to work with you to get everything merged in(Or send them to you in smaller more digestable chunks if you prefer)