Switch to internal representation of strings instead of tempfiles
Clean up process handling, correct tests, and add docstrings to main methods