Div with mul

Replace division by constants with multiplication, additions, shifts.
This doesn't follow the mono coding conventions. Use a typedef for structs.