Stop using div_rem()

div_rem() has been deprecated and all it ever did was do a divide
and then a remainder operation. So there is no harm in removing use of
this function and just doing what it was doing inline. On a side note,
LLVM optimizes a divide followed by a remainder into a single instruction
(at least on x86).