Add division emulation code

Measurement indicates that this is code is reasonably performant while
respecting code size.