Use uint[8/32/64]_t; support bitscan and -count on other compilers

- remove use of long long
- use explicitly sized integers uint8_t, uint32_t, &c.
- If GCC / Clang intrinsics are not available, use Visual C or generic
  code for bitscan and bitcount functions.