fix topology regression from Scala conversion

appears I was careless
fix regression in Color.getClosestColorNumberByHSB

dates back to when it was converted in Scala in 2011
oops fix wrong type in Optimizer

thanks 2.11 compiler for noticing!
rename a class to make more sense
cleanup: change `var` into `val`, because we can
remove unused imports