Optimize John Resig's inheritance pattern (cc.Class.extend) with advanced property initialization.

Use 'new Function' to initialize all properties in the constructor in order to
stablize the memory layout of an instance while avoiding turning turning objects
to dictionary mode in V8.
Address Dinping's review: place .ctor in cocos2d_extern.js so that Closure Compiler won't obfucate it.
Merge pull request #1015 from oupengsoftware/taskbranch/COCOS2D-51-1-rebased

Thank you very much, Kenny.
It's wonderful!