Devectorize expectedValueFunction computation

This brings the relative runtime (compared to your master) to 0.95 or so on my machine, not really a big gain.