Measures

Measures are now classes so they can be pickled, and parallelized.