Integrated Len Hamey's better definitions of signed div and mod