memoize specString

I haven't done any benchmarks, but this will quite obviously improve performance.

Nice library by the way!