Fixed Core Data external data reference saving errors.
Otherwise when the data model has BLOBs > 1MB in size and it tries to save these as external data, this error occurs:
	Can't open externalDataReference interim file : 2
    at  (Core Data offsets as of 10.8.3 Build 12D78)
     - [NSSQLCore writeExternalDataReferences] + 210
     - [NSSQLCore saveChanges:] + 280
     - [NSSQLCore executeRequest:withContext:error:] + 298
     - [NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1756
     - [NSManagedObjectContext save:] + 456
     - [BSManagedDocument preflightURL:thenSaveContext:error:]

This is done by never touching the main context outside the main thread and just use the parent context instead.
But I had to make the contexts read-only and non-assignable in the mean time and not cater for non-ARC nor non 10.7+ code.
Probably shouldn't have removed the call to setUndoManager.
Fixed a race condition when the main context gets created before the parent context is set-up.
The symptom was a Core Data exception saying that it couldn't find certain entity types when the document is opened.