Core data concurrency refactor.

Change-Id: I110790c9d61755c46bcbdd4d57adeab5cf3fda0a