map-helpers overhaul

* rename functions, these names are taken from common function names in e.g.
  OpenGL and other libraries:
  - rotator -> wrap
  - getLimiter -> clamp
  - returnIndex -> constant
* write tests for all 3 functions