Add AVX2/BMI1/BMI2 detection support

Also clean up the formatting in a bit of the CPU detection code.
Merge pull request #864 from FioraAeterna/avx2bmi

Add AVX2/BMI1/BMI2 detection support