add BigInt prevpow2/nextpow2 (fix #4814)

Implemented in terms of `ndigits(2,x)`, which is documented to give the most-significant-bit in GMP.  Fixes #4814.

Also adds some test cases.  Note that I implemented the current semantics, but these may be altered by #4819.