added string boundary check

added string boundary test with tests

better error reporting

edge detection
Merge pull request #36 from spreeker/master

added string boundary checks with tests