Fixes for issue #336 in Importance sampling and Forward sampling.
Includes a test to check for the error. Note, this error was not
reproducable using Containers.

Also includes a small change in BP that runs message passing in parallel
using Scala's parallel collections