Initial port
Memory usage optimization (divided by more than 6)
Minor optimizations
Refactoring
 - Move all non-class functions into the main ColorThiefPHP class.
 - Prefixing constants to avoid conflicts.
Add short-circuit test