Allow on-disk HDF5 datasets

Fix for #876.

HDF5 selections have some limitations that resulted in the original implementation of HDF5Dataset loading all data into memory. This PR allows HDF5 datasets to remain on disk.

There is a bit of a hack, in that I change the class of the dataset iterator at runtime (instead of using a copy constructor, for instance), but it seems to work.