Added Support for HD graphics when iPad is in compatibility mode.

experimental stuff!
Reorderchild and insert child optimizations

Now for every added element and reordered element a linear search is performed and items in the children and/or descendants array are shifted when the new/reorderd child is added.

This implementation batches all the changes and does one insertion sort on the children array, in case of CCSpriteBatchNode it also gives each child a new atlasIndex and performs one insertion sort on the descendants array.

What has changed?
- CCNode, addChild, reorderChild are changed
sortAllChildren is added
isReorderChildDirty_ is added
visit is changed

- CCSprite
sortAllChildren is overriden
reorderChild and addChild are changed
setReorderChildDirtyRecursively is added

- CCSpriteBatchNode
- addChild and reorderChild are changed
- appendChild, updateAtlasIndexes, sortDescendants are added
- visit is slightly changed, sortAllChildren is changed

What does it do?

- CCNode, a added child is appened to the children array, a reorderd child z-order is set immediately. Sorting happens before drawing. A dirty bool keeps track if sorting is necessary or not.

- CCSprite, overrides sortChildren, when it is added to a batchNode it also sorts its children recursively.

-CCSpriteBatchNode, a new child is appended to the descendants array as well. Sorting is 3 stages. First recursively all children are sorted based on their zOrder. Second every child gets a new atlasIndex, based on their relative zOrder (keeping parent -> child relations intact). Third all descendants and quads are sorted based on the atlasIndex.

All intense looping methods are optimized with fast dispatch.
Minor bug fix for reorder/add child. New children added couldn't be removed in the same frame
Reorder sprite
Merge branch 'iPadHD' of github.com:cocos2d/cocos2d-iphone into reorderSprite

Conflicts:
	cocos2d-ios.xcodeproj/project.pbxproj
Updated project
Removed iPadHD code from reorderBranch

Why is this code here?
ReorderChild and AddChild optimizations

This version performs better than the last version, I've reduced the number of traverses th
rough the descendants array to one. Now in one step every item gets its right atlasIndex an
d it gets reorderd at the same time.

To solve the order problem I described in my last comment, I had to introduce a global vari
able (using the director) that keeps track of the order of calling -addChild and -reorderChild

Performance comparison

                                          current this one
add 15% of 1000 sprites randomly          60ms    27ms
remove 15% of 1000 sprites                58ms    44ms
reorder 15% of 1000 sprites rand.         188ms   76ms
reorder 15% of 1000 sprites in order      190ms   72ms
reorder 15% of 1000 sprites in rev. order 196ms   62ms
add 15% of 1000 sprites in order          33ms     5ms
add 15% of 1000 sprites in rev. order     36ms     7ms

Compared to the last version a few things have changed

CCDirector
added getMutableIndex, resetMutableIndex methods
added mutableIndex_ property

SpriteTest
Added a test to check if the index in the children array is correct when when reordering multiple children to a already existing zOrder.

PerformanceNodeChildrenTest
Added several tests to include best and worst case scenarios for reordering and adding.
This will make the comparison between different algorithms more clearer.

CCDirectorIOS
modified the mainLoop, have to reset mutableIndex every frame

CCNode
modified visit, sets mutableIndex on 0
added int mutatedIndex

CCBatchNode
removed sortDescendants
modified visit, sets mutableIndex on 0
This fix addresses a nasty bug in the sorting code. The bug was spotted by forum member nico.
Merge branch 'develop' into reorderSprite

Conflicts:
	cocos2d-ios.xcodeproj/project.pbxproj
	cocos2d/CCNode.m
	cocos2d/CCSprite.m
	tests/PerformanceTests/PerformanceNodeChildrenTest/PerformanceNodeChildrenTest.h
	tests/PerformanceTests/PerformanceNodeChildrenTest/PerformanceNodeChildrenTest.m
	tests/SpriteTest.m
updated Xcode project
Reorder: compiles SpriteTest
This commit fixes a bug where reordering doesn't start when non direct children  of a batchnode are reordered.

The changes in the spriteTest are some name changes for a additional sorting test
This commit is a patch for the last commit. It also contains a new sprite test to test a reported bug in the spritebatchnode reordering.
Merge branch 'develop' into reorderSprite
Merge branch 'develop' into reorderSprite
Merge remote branch 'refs/remotes/araker/reorderSprite' into reorderSprite
Merge branch 'develop' into reorderSprite
Merge branch 'develop' into reorderSprite

Conflicts:
	templates/Xcode3_templates/cocos2d_box2d_app/Resources/iTunesArtwork
	templates/Xcode3_templates/cocos2d_chipmunk_app/Resources/iTunesArtwork
	templates/Xcode4_templates/cocos2dios.xctemplate/Resources/iTunesArtwork
Merge branch 'develop' into reorderSprite

Conflicts:
	cocos2d/CCSpriteBatchNode.h