Use BigInteger.signum() rather than .compareTo(ZERO)

Replace usage of BigInteger.compareTo(BigInteger.ZERO) with BigInteger.signum() as it's easier to read and more performant. Passes all unit tests.