data: implement resampling by class

    - get_timeseries_dict now needs to now about state-vectors, in order
      to implement the on-the-fly resampling correctly
    - a few minor multiprocessing optimisations as well