some benchmarking
filter out the selected logic from the display code
Use CSS classes for selection color instead of fills.
This makes the code way faster: from 140ms to 30ms on keypress.
More details here:
http://nelsonslog.wordpress.com/2013/03/16/optimizing-zipdecode/
http://nelsonslog.wordpress.com/2013/03/16/animating-css-class-changes-with-d3/