unittests: test full 16 bit range for bitarithm

Also uses a better pseudo random number.
Revert "core: faster bitarithm_msb"

This reverts commit ed7e233876239e5a6815150c33fb74215069f829.
Merge pull request #2094 from OlegHahm/fix_bitarithm

core: Fix bitarithm and unittests