feat(numerics): add is_prime function

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(numerics): add gcd and extended gcd templates (for primitive types)

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>