Reduce redundancy across integer operations

These changes reduce duplication of code for integer primitives both internally and in back ends.