More code cleanup and commenting, move the failed color segmentation code to a seperate module to improve readability (it is sort of dead code at this stage).