Move std::num::Integer to libnum

This is part of the effort to simplify `std::num`, as tracked in issue #10387.