New StringStore implementation.

The old one was much too complicated and (I think) had some bug somewhere that
could lead to a segfault down the line. The new one is much simpler.