substr is non-standard, and slice handles negative indexes sensibly.
Merge pull request #8 from ljharb/use_slice

substr is non-standard, and slice handles negative indexes sensibly.