Remove dependency of main on OpenSSL bignum

This patch moves/implements all logic (multiplication, division, GetCompact, SetCompact) that main used from CBigNum to base_uint or uint256, and replaces its call sites by equivalent uint256 operations.

The division and multiplication operations are very straightforward, but not very efficient. None of their call sites require that, though.

Together with #3965 and #4048, this will allow up to drop bignum.h entirely.