Mod handles more simplification

This builds off of my mod branch (#1913) and does more simplifications of mod (without using nsimplify which is an approximation).

**only the last commit need be reviewed here as the others are part of #1925 **