Add mod p param to some betti_C stuff.

This code really needs to be cleaned up sometime... left betti_C itself
without the mod p to avoid needing to change lots of other things.