Fix for crash related to an error overreleasing while saving.
Added a concept of versioning for thread contexts. Fixes an issue where after rebuilding the CoreData stack, old thread contexts were re-used causing a crash.