Change make_index to return a shared pointer.

This may incur some overhead---however, this makes client code much more
safe, particularly when constructing classifiers. With this change, it
should be impossible for an index to be destroyed before the things that
are using it.
Merge branch 'develop' of github.com:meta-toolkit/meta into develop