math/module: Expose popcount and min_bit to Python
Register: Add an affine_register function