Use std::list so that we have a stable iterator.

I will try to avoid creating these std::strings, but for now this gets
the tests passing with libc++.