clean up types a bit

particularly clean up the IntRange type to make it look the same
in python and c++ and add a test.