Added the string_slice function.

The test suite for string_slice is very extensive, because many cases are
subtle and potentially dangerous.

I am also using assert.h for extra insurance against software defects.