Fixed miscellaneous issues + worked on LR

- distance measures now return 0.0 for datasets/subsets with < 2
accessions (resulted in NaN before)
- generalized distance measure to work with any IndexType (including
caching)
- flush cache when setting (new) dataset; currently only implemented in
distance measures and PN & CV (should be fixed for other measures later)
- resolved several unchecked conversions/method calls
- worked on LR search (still not complete)