Clean up some logic
Just use "string" instead of "stringstream"

Seems like building a string character by character is much faster if
you just use the string class directly.
Remove an unused import