fixes from pitfiend
add reallocarray as defined by OpenBSD
to ease implementation, turn uintmax_t into uint128_t on 64-bit platforms
make assertion nicer