Initial support for caching sort indices.  See #84.