Use intrin.h for MSVC 8. Restore #pragma intrinsic for MSVC 7.1.

Also removed some code duplication.