Optimized divMod in poly

Made a huge speed improvement in debug mode. Only a few % in release,
but the memory load should be somewhat lower.