extensive rewrite to allow multi-integrands
cleanup for v2.0
more cleanup