This converts the stock strings API to be more safe-rust style. The API is kept roughly the same for now but moved to methods on the context.