py: Make built-in 'range' a class.

Addresses issue #487.