Optimized switch

For shitty JS engines that don't compile the switch to a jump table.
They should encounter less if/else'ing before the correct case now.