bn: invm() routine, positive mod()