Replace class check if's for switch (100% Faster)

Ran a few jsperfs and decided to change the multiple class check if
statements over to a switch, same functionality but 99% (±1.48%) faster.