Fix linking of private Xcode frameworks, and add code to automatically generate header stubs required by the class-dump generated headers.

The stub headers still have some issues; specifically, they'll import
headers that contain references to protocols already defined in other
frameworks, eg, NSObject.