Secure coding

Additions to the NSSecureCoding work that I had to make to make this run with my existing project that uses XPC & NSSecureCoding.

I documented the reasoning behind all of the changes I made, either as a comment in the code or in the commit message.