Added division with remainder functions, and tidied up ZZ module a bit.