libcore: Add range_step and range_rev functions.

Per #1817

Counting-down range is named `range_rev` rather than `rrange` to distinguish it from plain `range` more (obviously this can change).