Support java6

If this library is going to be generally useful, I think we should avoid java7 features, as many people are stuck
on legacy java versions. The changes aren't that terrible anywy. Applies on top of the string API pull request.