Made the integer division class more explicit in what it's doing. Also, added a division-by-zero exception, to catch it before it happens, and added exception-handling code to the procedures that use the code that potentially throws division by zero.

In addition, the exception type I used for the invalid comparison was wrong. I've corrected it here.