Code cleanup and subtle bug fixes

* Pervasive: Use CHAR_BIT from <limits.h> instead of __CHAR_BIT__ (this fixes builds on implementations that don't have __CHAR_BIT__).
* #31: Include <stdint.h> for SIZE_MAX.
* #192, pervasive: Remove/substitute allbits1 for SIZE_MAX in <stdint.h>.
* #197: Check that size_t has more than 16 bits before shifting it by 16 bits (avoid undefined behaviour on systems where sizeof(x)*CHAR_BIT == 16) (use preprocessor if branching overhead is a concern here)
* #198: Check that size_t h.s more than 32 bits before shifting it by 32 bits (guarantee predictable behaviour for systems that have strange size_t sizes such as 48 bits) (use preprocessor if branching overhead is a concern here)
* #202, #203: Replace magic numbers with required constants (from <limits.h>) that commonly have those values.