Make range generic over signed integers

Signed integers allow for generic +ve/-ve offsets.

r? @pcwalton