Renamed SafeSubstring param and supporting logic

SafeSubstring was passing "length" as "startIndex" incorrectly.
Added tests for SafeSubstring

Added tests to validate the index and length parameters of the underlying Substring.
Merge pull request #414 from jerbri/patch-1

Renamed SafeSubstring param and supporting logic