add bit operations to SafeLong
Add bit operations to Number, with other improvements.

This commit adds some more Number tests, and cleans up the code dealing
with different kinds of Numbers. It also fixes some equality bugs.