Reorganized code. Added C PNG support.