ressurect optimizeShifts (just in js optimizer and tests), with a fix for ensuring at most one value with unknown lower bits; #2481