added optimized version of reverse string

works well for large strings, while regular works best for small
strings. this is because the original will take up more memory in the
long run due to constantly creating new Strings. The optimized version
only creates it once with the constructor