Add range function to cut

Refs #37
Refactor a bit (as @rossjones suggests in #39)
Merge pull request #45 from andylolz/37-cut-ranges

Add range function to cut