Fix iOS bundle template for xcode 5

On Xcode6, we get duplicate build phases because we pull in another plist from
apple that provides this. It would be best if we did not have duplicate build
phases, but we need this for now until we drop xcode5 support.
Factor out some common functionality from xctest support