Refactor defined MATH_BIGINTEGER_ constants into class constants.

Replaces #521