Division and mod test program

This test program math.cpp tests division and mod, revealing possible overflow problems.  It contains suggested alternative implementations that do not suffer from overflow problems while computing the same results for smaller input values.  I have sent a detailed email to abadams.

Hopefully this pull request will only bring math.cpp.  If it brings other files, that would be due to problems I have been having with github merges.

Regards
Len Hamey
len.hamey@mq.edu.au