Migrated ThreadedCoreData to unified API

- Cast nint to int
- Cast string to NSString
- Changed Action in InvokeOnMainThread back to Selector after it was
changed by the tool