This moves a large amount of num_impl code into tests.c because we only ever use it in tests anymore. Likewise for secp256k1_gej_is_valid_var.
The -Wunused-function is only enabled when all modules are turned on and when static precomp is off. This avoids warnings for the few parts of the base library which are only used by modules (or pre-computation).
[Note, the description of this PR has changed significantly since it was opened, because the PR was narrowed to only being unused clean in an all-modules build.]