String index fixes and allow negative indices

This pullrequest adds support for using negative indices in Strings to index a String from the end instead of the start. This changes all methods that accept indices: `operator[]`, `charAt`, `setCharAt`, `indexOf`, `lastIndexOf`, `substring` and `remove`.

I also added some fixes and simplifications I ran across while implementing the negative indices.