Merge classify and dispatch switch statements.

Current compilers do not optimize this, so we have to do
the merge by hand to gain ~2x performance.