Implement the %, ^, %=, ^=, &= and |= operators

fixes #7813