Yet more string optimizations

- Removed unnecessary string searches
- Prevent repeated re-allocation in string::append