Added `def slice(string, range)` to the top as @pmintem suggested and a few
more test cases.