Refactor CCImage and CCTexture2D

Refactor CCImage and CCTexture2D, make CCImage support for gray image data and add some convert function of convert image data to different texture data.
Build the libjepg, libpng and libtiff to support ios and mac, Let the ios and mac use the these library to parse the image file.