Add AVX2/BMI1/BMI2 detection support

Also clean up the formatting in a bit of the CPU detection code.

(Can someone actually test this? I don't have a Haswell yet ^^;)