Move divisor_sum to XS; more XS interface cleanup