add unsignedDifference function

to avoid typing x >= y ? x - y : y - x or casting/abs all over the place